summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7ddc48)
raw | patch | inline | side by side (parent: a7ddc48)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 16 Jan 2007 21:18:44 +0000 (16:18 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 16 Jan 2007 21:18:44 +0000 (16:18 -0500) |
To help callers repack very large repositories into a series of
packfiles fast-import now outputs the last commits/tags it wrote to
a packfile when it prints out the packfile name. This information
can be feed to pack-objects --revs to repack. For the first pack
of an initial import this is pretty easy (just feed those SHA1s on
stdin) but for subsequent packs you want to feed the subsequent
pack's final SHA1s but also all prior pack's SHA1s prefixed with
the negation operator. This way the prior pack's data does not
get included into the subsequent pack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
packfiles fast-import now outputs the last commits/tags it wrote to
a packfile when it prints out the packfile name. This information
can be feed to pack-objects --revs to repack. For the first pack
of an initial import this is pretty easy (just feed those SHA1s on
stdin) but for subsequent packs you want to feed the subsequent
pack's final SHA1s but also all prior pack's SHA1s prefixed with
the negation operator. This way the prior pack's data does not
get included into the subsequent pack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 3992af5f2561f664e62c22bad5fe9d099cba28a4..84dfde9d2f47d65757778982fea2e6c480f5c79b 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
const char *name;
unsigned long last_commit;
struct tree_entry branch_tree;
+ unsigned int pack_id;
unsigned char sha1[20];
};
{
struct tag *next_tag;
const char *name;
+ unsigned int pack_id;
unsigned char sha1[20];
};
get_object_directory(), sha1_to_hex(pack_data->sha1));
if (move_temp_to_file(pack_data->pack_name, name))
die("cannot store pack file");
- printf("%s\n", name);
snprintf(name, sizeof(name), "%s/pack/pack-%s.idx",
get_object_directory(), sha1_to_hex(pack_data->sha1));
if (object_count) {
char *idx_name;
+ int i;
+ struct branch *b;
+ struct tag *t;
fixup_header_footer();
idx_name = keep_pack(create_index());
if (!new_p)
die("core git rejected index %s", idx_name);
new_p->windows = old_p->windows;
- all_packs[pack_id++] = new_p;
+ all_packs[pack_id] = new_p;
install_packed_git(new_p);
+
+ /* Print the boundary */
+ fprintf(stdout, "%s:", new_p->pack_name);
+ for (i = 0; i < branch_table_sz; i++) {
+ for (b = branch_table[i]; b; b = b->table_next_branch) {
+ if (b->pack_id == pack_id)
+ fprintf(stdout, " %s", sha1_to_hex(b->sha1));
+ }
+ }
+ for (t = first_tag; t; t = t->next_tag) {
+ if (t->pack_id == pack_id)
+ fprintf(stdout, " %s", sha1_to_hex(t->sha1));
+ }
+ fputc('\n', stdout);
+
+ pack_id++;
}
else
unlink(old_p->pack_name);
new_data.buffer, sp - (char*)new_data.buffer,
NULL, b->sha1, next_mark);
b->last_commit = object_count_by_type[OBJ_COMMIT];
+ b->pack_id = pack_id;
if (branch_log) {
int need_dq = quote_c_style(b->name, NULL, NULL, 0);
store_object(OBJ_TAG, new_data.buffer, sp - (char*)new_data.buffer,
NULL, t->sha1, 0);
+ t->pack_id = pack_id;
if (branch_log) {
int need_dq = quote_c_style(t->name, NULL, NULL, 0);