summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-04-10 12:56:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-11 01:43:02 (GMT)
commit7547b95b4fbb8591726b1d9381c176cc27fc6aea (patch)
tree0de2b763a40f4c07eee2ddbf40fd50eaf82dc996 /builtin
parent3d5df01b5e42416a59e857135e932bbdd8cc3ba0 (diff)
downloadgit-7547b95b4fbb8591726b1d9381c176cc27fc6aea.zip
git-7547b95b4fbb8591726b1d9381c176cc27fc6aea.tar.gz
git-7547b95b4fbb8591726b1d9381c176cc27fc6aea.tar.bz2
commit-graph: implement "--append" option
Teach git-commit-graph to add all commits from the existing commit-graph file to the file about to be written. This should be used when adding new commits without performing garbage collection. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit-graph.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index b5c0b08..37420ae 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -8,7 +8,7 @@
static char const * const builtin_commit_graph_usage[] = {
N_("git commit-graph [--object-dir <objdir>]"),
N_("git commit-graph read [--object-dir <objdir>]"),
- N_("git commit-graph write [--object-dir <objdir>] [--stdin-packs|--stdin-commits]"),
+ N_("git commit-graph write [--object-dir <objdir>] [--append] [--stdin-packs|--stdin-commits]"),
NULL
};
@@ -18,7 +18,7 @@ static const char * const builtin_commit_graph_read_usage[] = {
};
static const char * const builtin_commit_graph_write_usage[] = {
- N_("git commit-graph write [--object-dir <objdir>] [--stdin-packs|--stdin-commits]"),
+ N_("git commit-graph write [--object-dir <objdir>] [--append] [--stdin-packs|--stdin-commits]"),
NULL
};
@@ -26,6 +26,7 @@ static struct opts_commit_graph {
const char *obj_dir;
int stdin_packs;
int stdin_commits;
+ int append;
} opts;
static int graph_read(int argc, const char **argv)
@@ -94,6 +95,8 @@ static int graph_write(int argc, const char **argv)
N_("scan pack-indexes listed by stdin for commits")),
OPT_BOOL(0, "stdin-commits", &opts.stdin_commits,
N_("start walk at commits listed by stdin")),
+ OPT_BOOL(0, "append", &opts.append,
+ N_("include all commits already in the commit-graph file")),
OPT_END(),
};
@@ -131,7 +134,8 @@ static int graph_write(int argc, const char **argv)
pack_indexes,
packs_nr,
commit_hex,
- commits_nr);
+ commits_nr,
+ opts.append);
return 0;
}