From: Junio C Hamano Date: Fri, 12 Apr 2013 18:48:38 +0000 (-0700) Subject: Merge branch 'maint-1.8.1' into maint X-Git-Tag: v1.8.2.2~54 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7f20008d14e3eececdc90c75d3a86ee6c250cb67?ds=inline;hp=-c Merge branch 'maint-1.8.1' into maint * maint-1.8.1: fast-export: fix argument name in error messages Documentation: distinguish between ref and offset deltas in pack-format --- 7f20008d14e3eececdc90c75d3a86ee6c250cb67 diff --combined Documentation/technical/pack-format.txt index 0e37ec9de5,f194d1c6aa..a37f1378d0 --- a/Documentation/technical/pack-format.txt +++ b/Documentation/technical/pack-format.txt @@@ -1,4 -1,4 +1,4 @@@ -GIT pack format +Git pack format =============== == pack-*.pack files have the following format: @@@ -9,7 -9,7 +9,7 @@@ The signature is: {'P', 'A', 'C', 'K'} 4-byte version number (network byte order): - GIT currently accepts version number 2 or 3 but + Git currently accepts version number 2 or 3 but generates version 2 only. 4-byte number of objects contained in the pack (network byte order) @@@ -26,7 -26,9 +26,9 @@@ (deltified representation) n-byte type and length (3-bit type, (n-1)*7+4-bit length) - 20-byte base object name + 20-byte base object name if OBJ_REF_DELTA or a negative relative + offset from the delta object's position in the pack if this + is an OBJ_OFS_DELTA object compressed delta data Observation: length of each object is encoded in a variable diff --combined builtin/fast-export.c index 77dffd1ce3,06a52798f1..ad9d0c46e8 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@@ -43,7 -43,7 +43,7 @@@ static int parse_opt_signed_tag_mode(co else if (!strcmp(arg, "strip")) signed_tag_mode = STRIP; else - return error("Unknown signed-tag mode: %s", arg); + return error("Unknown signed-tags mode: %s", arg); return 0; } @@@ -416,7 -416,7 +416,7 @@@ static void handle_tag(const char *name switch(signed_tag_mode) { case ABORT: die ("Encountered signed tag %s; use " - "--signed-tag= to handle it.", + "--signed-tags= to handle it.", sha1_to_hex(tag->object.sha1)); case WARN: warning ("Exporting signed tag %s", @@@ -474,21 -474,18 +474,21 @@@ (int)message_size, (int)message_size, message ? message : ""); } -static void get_tags_and_duplicates(struct object_array *pending, +static void get_tags_and_duplicates(struct rev_cmdline_info *info, struct string_list *extra_refs) { struct tag *tag; int i; - for (i = 0; i < pending->nr; i++) { - struct object_array_entry *e = pending->objects + i; + for (i = 0; i < info->nr; i++) { + struct rev_cmdline_entry *e = info->rev + i; unsigned char sha1[20]; - struct commit *commit = commit; + struct commit *commit; char *full_name; + if (e->flags & UNINTERESTING) + continue; + if (dwim_ref(e->name, strlen(e->name), sha1, &full_name) != 1) continue; @@@ -526,14 -523,10 +526,14 @@@ typename(e->item->type)); continue; } - if (commit->util) - /* more than one name for the same object */ + + /* + * This ref will not be updated through a commit, lets make + * sure it gets properly updated eventually. + */ + if (commit->util || commit->object.flags & SHOWN) string_list_append(extra_refs, full_name)->util = commit; - else + if (!commit->util) commit->util = full_name; } } @@@ -621,10 -614,6 +621,10 @@@ static void import_marks(char *input_fi if (object->flags & SHOWN) error("Object %s already has a mark", sha1_to_hex(sha1)); + if (object->type != OBJ_COMMIT) + /* only commits */ + continue; + mark_object(object, mark); if (last_idnum < mark) last_idnum = mark; @@@ -688,7 -677,7 +688,7 @@@ int cmd_fast_export(int argc, const cha if (import_filename && revs.prune_data.nr) full_tree = 1; - get_tags_and_duplicates(&revs.pending, &extra_refs); + get_tags_and_duplicates(&revs.cmdline, &extra_refs); if (prepare_revision_walk(&revs)) die("revision walk setup failed");