summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-11 20:34:57 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-11 20:34:57 -0800
commitb578e509d3d346513efda14606886a55174e5181 (patch)
tree3019a31dcc68a665620ecdb6fc8544d294d2a87f
parentd4144612958c255d273ad1bd1fe33f03c0f67ada (diff)
parentc6ec3b13b81d59272e41d5316689c65dd4cc2e63 (diff)
downloadgit-b578e509d3d346513efda14606886a55174e5181.tar.gz
Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport: bash: Hide git-fast-import. fast-import: Add tip about importing renames. fast-import: Hide the pack boundary commits by default.
-rw-r--r--Documentation/git-fast-import.txt16
-rwxr-xr-xcontrib/completion/git-completion.bash1
-rw-r--r--fast-import.c35
-rwxr-xr-xt/t9300-fast-import.sh26
4 files changed, 67 insertions, 11 deletions
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 2a5052072a..939ec4652b 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -64,6 +64,15 @@ OPTIONS
Frontends can use this file to validate imports after they
have been completed.
+--export-pack-edges=<file>::
+ After creating a packfile, print a line of data to
+ <file> listing the filename of the packfile and the last
+ commit on each branch that was written to that packfile.
+ This information may be useful after importing projects
+ whose total object set exceeds the 4 GiB packfile limit,
+ as these commits can be used as edge points during calls
+ to gitlink:git-pack-objects[1].
+
--quiet::
Disable all non-fatal output, making fast-import silent when it
is successful. This option disables the output shown by
@@ -706,6 +715,13 @@ The branch LRU builtin to fast-import tends to behave very well, and the
cost of activating an inactive branch is so low that bouncing around
between branches has virtually no impact on import performance.
+Handling Renames
+~~~~~~~~~~~~~~~~
+When importing a renamed file or directory, simply delete the old
+name(s) and modify the new name(s) during the corresponding commit.
+Git performs rename detection after-the-fact, rather than explicitly
+during a commit.
+
Use Tag Fixup Branches
~~~~~~~~~~~~~~~~~~~~~~
Some other SCM systems let the user create a tag from multiple
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index eecdaa0e75..5d3d402051 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -270,6 +270,7 @@ __git_commands ()
cvsserver) : daemon;;
daemon) : daemon;;
diff-stages) : nobody uses it;;
+ fast-import) : import;;
fsck-objects) : plumbing;;
fetch-pack) : plumbing;;
fmt-merge-msg) : plumbing;;
diff --git a/fast-import.c b/fast-import.c
index 3f4e73f821..f9cfc72637 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -261,6 +261,7 @@ static unsigned long object_count;
static unsigned long branch_count;
static unsigned long branch_load_count;
static int failure;
+static FILE *pack_edges;
/* Memory pools */
static size_t mem_pool_alloc = 2*1024*1024 - sizeof(struct mem_pool);
@@ -811,18 +812,21 @@ static void end_packfile(void)
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));
+ if (pack_edges) {
+ fprintf(pack_edges, "%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(pack_edges, " %s", sha1_to_hex(b->sha1));
+ }
}
+ for (t = first_tag; t; t = t->next_tag) {
+ if (t->pack_id == pack_id)
+ fprintf(pack_edges, " %s", sha1_to_hex(t->sha1));
+ }
+ fputc('\n', pack_edges);
+ fflush(pack_edges);
}
- 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++;
}
@@ -1988,7 +1992,13 @@ int main(int argc, const char **argv)
max_active_branches = strtoul(a + 18, NULL, 0);
else if (!strncmp(a, "--export-marks=", 15))
mark_file = a + 15;
- else if (!strcmp(a, "--force"))
+ else if (!strncmp(a, "--export-pack-edges=", 20)) {
+ if (pack_edges)
+ fclose(pack_edges);
+ pack_edges = fopen(a + 20, "a");
+ if (!pack_edges)
+ die("Cannot open %s: %s", a + 20, strerror(errno));
+ } else if (!strcmp(a, "--force"))
force_update = 1;
else if (!strcmp(a, "--quiet"))
show_stats = 0;
@@ -2033,6 +2043,9 @@ int main(int argc, const char **argv)
unkeep_all_packs();
dump_marks();
+ if (pack_edges)
+ fclose(pack_edges);
+
if (show_stats) {
uintmax_t total_count = 0, duplicate_count = 0;
for (i = 0; i < ARRAY_SIZE(object_count_by_type); i++)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 357a8724dd..8d28211294 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -407,4 +407,30 @@ test_expect_success \
'git-cat-file blob H:h/e/l/lo >actual &&
diff -u expect actual'
+###
+### series I
+###
+
+cat >input <<INPUT_END
+commit refs/heads/export-boundary
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+we have a border. its only 40 characters wide.
+COMMIT
+
+from refs/heads/branch
+
+INPUT_END
+test_expect_success \
+ 'I: export-pack-edges' \
+ 'git-fast-import --export-pack-edges=edges.list <input'
+
+cat >expect <<EOF
+.git/objects/pack/pack-.pack: `git-rev-parse --verify export-boundary`
+EOF
+test_expect_success \
+ 'I: verify edge list' \
+ 'sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
+ diff -u expect actual'
+
test_done