Changeset 25503 in project
- Timestamp:
- 11/14/11 23:41:17 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/eggref/4/git
r25496 r25503 358 358 359 359 Returns 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 entry361 name.360 object is found. {{key}} may be a zero-based integer index or the full string 361 pathname of an entry name. 362 362 363 363 <procedure>(tree->list tree [repository]) => list</procedure> … … 404 404 <record>index</record> 405 405 <procedure>(index? obj) => boolean</procedure> 406 407 An {{index}} represents the on-disk state of Git's working tree. Changes made 408 to a given {{index}} exist only in memory until written to disk using 409 {{index-write}}. 410 406 411 <procedure>(index-open repo-or-path) => index</procedure> 412 413 It {{repo-or-path}} is a {{repository}}, returns the repository's index. If it 414 is a string, creates and returns the index at the given path, signaling an 415 error if such an index doesn't exist. It is not possible to open the index of a 416 bare repository, and doing so will result in an exception. 417 407 418 <procedure>(index-entrycount index) => int</procedure> 408 419 <procedure>(index-entrycount-unmerged index) => int</procedure> 420 421 Returns the total number of index entries and unmerged index entries of the 422 given {{index}}, respectively. This is essentially a count of all files tracked 423 by Git in a given repository. 424 409 425 <procedure>(index-read index) => void</procedure> 426 427 Updates the given {{index}} to reflect the current state of the on-disk 428 repository. 429 410 430 <procedure>(index-write index) => void</procedure> 431 432 Writes the state of the given {{index}} from memory onto disk, modifying the 433 repository on success. 434 411 435 <procedure>(index-clear index) => void</procedure> 436 437 Removes all enries from a given {{index}}. 438 412 439 <procedure>(index-add index path [stage]) => void</procedure> 440 441 Adds a given {{path}}, which must refer to a file relative to the index's 442 repository, to the {{index}}. If an integer {{stage}} is given, it will be used 443 as the staging number for the changes. 444 413 445 <procedure>(index-remove index ref) => void</procedure> 414 <procedure>(index-find index) => int</procedure> 415 <procedure>(index-ref index key) => index-entry</procedure> 446 447 Removes an entry from the given {{index}}. {{ref}} may be a file path string or 448 an zero-based integer index. If no entry is removed, {{#f}} is returned. 449 450 <procedure>(index-find index path) => int</procedure> 451 452 Returns the zero-based integer index of the file specified by {{path}} in the 453 given {{index}}, signaling an error if it doesn't exist. 454 455 <procedure>(index-ref index key [type]) => index-entry</procedure> 456 457 Returns the {{index-entry}} from the {{index}} for the given {{key}}, which may 458 be an zero-based integer index or a pathname string, or {{#f}} if no such entry 459 exists. If a type symbol is given, either {{merged}} (the default behavior) or 460 {{unmerged}}, the search will be limited to such entries. 461 416 462 <procedure>(index->list index [type]) => list</procedure> 463 464 Returns a list of all {{index-entry}} objects in the given {{index}}. If a type 465 symbol is given, either {{merged}} (the default behavior) or {{unmerged}}, the 466 returned list will be limited to such entries. 417 467 418 468 ==== Index Entry … … 420 470 <record>index-entry</record> 421 471 <procedure>(index-entry? obj) => boolean</procedure> 472 473 An {{index-entry}} represents a tracked file in Git's working directory, 474 belonging to an {{index}}. 475 422 476 <procedure>(index-entry-id index-entry) => oid</procedure> 477 478 Returns the {{oid}} referring to the given {{index-entry}}. 479 423 480 <procedure>(index-entry-path index-entry) => string</procedure> 481 482 Returns the file path of the given {{index-entry}} relative to the owning 483 repository's working directory. 484 424 485 <procedure>(index-entry-ctime index-entry) => int</procedure> 425 486 <procedure>(index-entry-mtime index-entry) => int</procedure> … … 433 494 <procedure>(index-entry-flags index-entry) => int</procedure> 434 495 <procedure>(index-entry-extended index-entry) => int</procedure> 435 <procedure>(index-entry->object repository index-entry) => object</procedure> 496 497 These methods return the file attributes for the given {{index-entry}} as it 498 exists in its in-memory {{index}}. 436 499 437 500 ==== ODB … … 439 502 <record>odb</record> 440 503 <procedure>(odb? obj) => boolean</procedure> 441 <procedure>(odb-new) => odb</procedure> 504 505 An {{odb}} offers a direct interface to Git's internal object database. 506 442 507 <procedure>(odb-open repo-or-path) => odb</procedure> 508 509 It {{repo-or-path}} is a {{repository}}, returns the repository's object 510 database. If it is a string, creates and returns the object database at the 511 given path, signaling an error if no such database exists. 512 443 513 <procedure>(odb-has-object? odb ref) => boolean</procedure> 514 515 Determines if the given {{odb}} contains the given object {{ref}}, which should 516 be a SHA1 string, {{oid}} or Git object of type {{commit}}, {{blob*}}, {{tree}} 517 or {{tag}}. 518 444 519 <procedure>(odb-read odb ref) => odb-object</procedure> 520 521 Reads the given object {{ref}} from the database, signaling an error if it 522 doesn't exist. {{ref}} should be a SHA1 string, {{oid}} or Git object of type 523 {{commit}}, {{blob*}}, {{tree}} or {{tag}}. 524 445 525 <procedure>(odb-write odb data [type]) => oid</procedure> 526 527 Writes a given data {{blob}} to the {{odb}}, returning an {{oid}} referring to 528 the newly-created object. The type of the stored data can be specified by an 529 optional {{type}} symbol, which defaults to {{blob}}. 530 446 531 <procedure>(odb-hash odb data [type]) => oid</procedure> 532 533 Returns an {{oid}} reference for the given data {{blob}} as though it had been 534 stored to the given {{odb}} but without writing it to disk. The type of the 535 hashed data can be specified by an optional {{type}} symbol, which defaults to 536 {{blob}}. 447 537 448 538 ==== ODB Object
Note: See TracChangeset
for help on using the changeset viewer.