Changeset 25503 in project


Ignore:
Timestamp:
11/14/11 23:41:17 (9 years ago)
Author:
evhan
Message:

finish git egg docs up to 0.0.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/git

    r25496 r25503  
    358358
    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.
    362362
    363363<procedure>(tree->list tree [repository]) => list</procedure>
     
    404404<record>index</record>
    405405<procedure>(index? obj) => boolean</procedure>
     406
     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
     409{{index-write}}.
     410
    406411<procedure>(index-open repo-or-path) => index</procedure>
     412
     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.
     417
    407418<procedure>(index-entrycount index) => int</procedure>
    408419<procedure>(index-entrycount-unmerged index) => int</procedure>
     420
     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.
     424
    409425<procedure>(index-read index) => void</procedure>
     426
     427Updates the given {{index}} to reflect the current state of the on-disk
     428repository.
     429
    410430<procedure>(index-write index) => void</procedure>
     431
     432Writes the state of the given {{index}} from memory onto disk, modifying the
     433repository on success.
     434
    411435<procedure>(index-clear index) => void</procedure>
     436
     437Removes all enries from a given {{index}}.
     438
    412439<procedure>(index-add index path [stage]) => void</procedure>
     440
     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.
     444
    413445<procedure>(index-remove index ref) => void</procedure>
    414 <procedure>(index-find index) => int</procedure>
    415 <procedure>(index-ref index key) => index-entry</procedure>
     446
     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.
     449
     450<procedure>(index-find index path) => int</procedure>
     451
     452Returns the zero-based integer index of the file specified by {{path}} in the
     453given {{index}}, signaling an error if it doesn't exist.
     454
     455<procedure>(index-ref index key [type]) => index-entry</procedure>
     456
     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.
     461
    416462<procedure>(index->list index [type]) => list</procedure>
     463
     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.
    417467
    418468==== Index Entry
     
    420470<record>index-entry</record>
    421471<procedure>(index-entry? obj) => boolean</procedure>
     472
     473An {{index-entry}} represents a tracked file in Git's working directory,
     474belonging to an {{index}}.
     475
    422476<procedure>(index-entry-id index-entry) => oid</procedure>
     477
     478Returns the {{oid}} referring to the given {{index-entry}}.
     479
    423480<procedure>(index-entry-path index-entry) => string</procedure>
     481
     482Returns the file path of the given {{index-entry}} relative to the owning
     483repository's working directory.
     484
    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>
     496
     497These methods return the file attributes for the given {{index-entry}} as it
     498exists in its in-memory {{index}}.
    436499
    437500==== ODB
     
    439502<record>odb</record>
    440503<procedure>(odb? obj) => boolean</procedure>
    441 <procedure>(odb-new) => odb</procedure>
     504
     505An {{odb}} offers a direct interface to Git's internal object database.
     506
    442507<procedure>(odb-open repo-or-path) => odb</procedure>
     508
     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.
     512
    443513<procedure>(odb-has-object? odb ref) => boolean</procedure>
     514
     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}}.
     518
    444519<procedure>(odb-read odb ref) => odb-object</procedure>
     520
     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}}.
     524
    445525<procedure>(odb-write odb data [type]) => oid</procedure>
     526
     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}}.
     530
    446531<procedure>(odb-hash odb data [type]) => oid</procedure>
     532
     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
     536{{blob}}.
    447537
    448538==== ODB Object
Note: See TracChangeset for help on using the changeset viewer.