Changeset 25503 in project

11/14/11 23:41:17 (9 years ago)

finish git egg docs up to 0.0.7

1 edited


  • wiki/eggref/4/git

    r25496 r25503  
    359359Returns a {{tree-entry}} object for the given {{key}}, or {{#f}} if no such
    360 object is found. {{key}} may be a numerical index or the string of an entry
    361 name.
     360object is found. {{key}} may be a zero-based integer index or the full string
     361pathname of an entry name.
    363363<procedure>(tree->list tree [repository]) => list</procedure>
    405405<procedure>(index? obj) => boolean</procedure>
     407An {{index}} represents the on-disk state of Git's working tree. Changes made
     408to a given {{index}} exist only in memory until written to disk using
    406411<procedure>(index-open repo-or-path) => index</procedure>
     413It {{repo-or-path}} is a {{repository}}, returns the repository's index.  If it
     414is a string, creates and returns the index at the given path, signaling an
     415error if such an index doesn't exist. It is not possible to open the index of a
     416bare repository, and doing so will result in an exception.
    407418<procedure>(index-entrycount index) => int</procedure>
    408419<procedure>(index-entrycount-unmerged index) => int</procedure>
     421Returns the total number of index entries and unmerged index entries of the
     422given {{index}}, respectively. This is essentially a count of all files tracked
     423by Git in a given repository.
    409425<procedure>(index-read index) => void</procedure>
     427Updates the given {{index}} to reflect the current state of the on-disk
    410430<procedure>(index-write index) => void</procedure>
     432Writes the state of the given {{index}} from memory onto disk, modifying the
     433repository on success.
    411435<procedure>(index-clear index) => void</procedure>
     437Removes all enries from a given {{index}}.
    412439<procedure>(index-add index path [stage]) => void</procedure>
     441Adds a given {{path}}, which must refer to a file relative to the index's
     442repository, to the {{index}}. If an integer {{stage}} is given, it will be used
     443as the staging number for the changes.
    413445<procedure>(index-remove index ref) => void</procedure>
    414 <procedure>(index-find index) => int</procedure>
    415 <procedure>(index-ref index key) => index-entry</procedure>
     447Removes an entry from the given {{index}}. {{ref}} may be a file path string or
     448an zero-based integer index. If no entry is removed, {{#f}} is returned.
     450<procedure>(index-find index path) => int</procedure>
     452Returns the zero-based integer index of the file specified by {{path}} in the
     453given {{index}}, signaling an error if it doesn't exist.
     455<procedure>(index-ref index key [type]) => index-entry</procedure>
     457Returns the {{index-entry}} from the {{index}} for the given {{key}}, which may
     458be an zero-based integer index or a pathname string, or {{#f}} if no such entry
     459exists. If a type symbol is given, either {{merged}} (the default behavior) or
     460{{unmerged}}, the search will be limited to such entries.
    416462<procedure>(index->list index [type]) => list</procedure>
     464Returns a list of all {{index-entry}} objects in the given {{index}}. If a type
     465symbol is given, either {{merged}} (the default behavior) or {{unmerged}}, the
     466returned list will be limited to such entries.
    418468==== Index Entry
    421471<procedure>(index-entry? obj) => boolean</procedure>
     473An {{index-entry}} represents a tracked file in Git's working directory,
     474belonging to an {{index}}.
    422476<procedure>(index-entry-id index-entry) => oid</procedure>
     478Returns the {{oid}} referring to the given {{index-entry}}.
    423480<procedure>(index-entry-path index-entry) => string</procedure>
     482Returns the file path of the given {{index-entry}} relative to the owning
     483repository's working directory.
    424485<procedure>(index-entry-ctime index-entry) => int</procedure>
    425486<procedure>(index-entry-mtime index-entry) => int</procedure>
    433494<procedure>(index-entry-flags index-entry) => int</procedure>
    434495<procedure>(index-entry-extended index-entry) => int</procedure>
    435 <procedure>(index-entry->object repository index-entry) => object</procedure>
     497These methods return the file attributes for the given {{index-entry}} as it
     498exists in its in-memory {{index}}.
    437500==== ODB
    440503<procedure>(odb? obj) => boolean</procedure>
    441 <procedure>(odb-new) => odb</procedure>
     505An {{odb}} offers a direct interface to Git's internal object database.
    442507<procedure>(odb-open repo-or-path) => odb</procedure>
     509It {{repo-or-path}} is a {{repository}}, returns the repository's object
     510database. If it is a string, creates and returns the object database at the
     511given path, signaling an error if no such database exists.
    443513<procedure>(odb-has-object? odb ref) => boolean</procedure>
     515Determines if the given {{odb}} contains the given object {{ref}}, which should
     516be a SHA1 string, {{oid}} or Git object of type {{commit}}, {{blob*}}, {{tree}}
     517or {{tag}}.
    444519<procedure>(odb-read odb ref) => odb-object</procedure>
     521Reads the given object {{ref}} from the database, signaling an error if it
     522doesn't exist. {{ref}} should be a SHA1 string, {{oid}} or Git object of type
     523{{commit}}, {{blob*}}, {{tree}} or {{tag}}.
    445525<procedure>(odb-write odb data [type]) => oid</procedure>
     527Writes a given data {{blob}} to the {{odb}}, returning an {{oid}} referring to
     528the newly-created object. The type of the stored data can be specified by an
     529optional {{type}} symbol, which defaults to {{blob}}.
    446531<procedure>(odb-hash odb data [type]) => oid</procedure>
     533Returns an {{oid}} reference for the given data {{blob}} as though it had been
     534stored to the given {{odb}} but without writing it to disk. The type of the
     535hashed data can be specified by an optional {{type}} symbol, which defaults to
    448538==== ODB Object
Note: See TracChangeset for help on using the changeset viewer.