Skip to content

Commit e2bfa50

Browse files
jmberggitster
authored andcommitted
pack-write/docs: update regarding pack naming
The index-pack documentation explicitly states that the pack name is derived from the sorted list of object names, but since commit 1190a1a ("pack-objects: name pack files after trailer hash") that isn't true anymore. Be less explicit in the docs as to what the exact output is, and just say that it's whatever goes into the pack name. Also update a comment on write_idx_file() since it no longer modifies the sha1 variable (it's const now anyway), as noted by Junio. Fixes: 1190a1a ("pack-objects: name pack files after trailer hash") Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1190a1a commit e2bfa50

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Documentation/git-index-pack.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ OPTIONS
9191
Note
9292
----
9393

94-
Once the index has been created, the list of object names is sorted
95-
and the SHA-1 hash of that list is printed to stdout. If --stdin was
94+
Once the index has been created, the hash that goes into the name of
95+
the pack/idx file is printed to stdout. If --stdin was
9696
also used then this is prefixed by either "pack\t", or "keep\t" if a
9797
new .keep file was successfully created. This is useful to remove a
9898
.keep file used as a lock to prevent the race with 'git repack'

pack-write.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ static int need_large_offset(off_t offset, const struct pack_idx_option *opts)
3838
}
3939

4040
/*
41-
* On entry *sha1 contains the pack content SHA1 hash, on exit it is
42-
* the SHA1 hash of sorted object names. The objects array passed in
43-
* will be sorted by SHA1 on exit.
41+
* The *sha1 contains the pack content SHA1 hash.
42+
* The objects array passed in will be sorted by SHA1 on exit.
4443
*/
4544
const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects,
4645
int nr_objects, const struct pack_idx_option *opts,

0 commit comments

Comments
 (0)