{"thread":{"id":"16264","subject":"[PATCH 6/9 v4] merge-base: add \"--bisect-replace\" option to use fixed up revs","startedAt":"2008-11-11T05:42:08Z","lastAt":"2008-11-11T05:42:08Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":4,"patchTotal":9},"messages":[{"id":"95434","messageId":"20081111064208.0de69887.chriscool@tuxfamily.org","threadId":"16264","inReplyTo":null,"subject":"[PATCH 6/9 v4] merge-base: add \"--bisect-replace\" option to use fixed up revs","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-11-11T05:42:08Z","receivedAt":"2008-11-11T05:42:08Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/git-merge-base.txt |    6 +++++-\n builtin-merge-base.c             |    8 +++++++-\n t/t6035-bisect-replace.sh        |    7 +++++++\n 3 files changed, 19 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt\nindex 2f0c525..af174f7 100644\n--- a/Documentation/git-merge-base.txt\n+++ b/Documentation/git-merge-base.txt\n@@ -8,7 +8,7 @@ git-merge-base - Find as good common ancestors as possible for a merge\n \n SYNOPSIS\n --------\n-'git merge-base' [--all] <commit> <commit>...\n+'git merge-base' [--all] [--bisect-replace] <commit> <commit>...\n \n DESCRIPTION\n -----------\n@@ -32,6 +32,10 @@ OPTIONS\n --all::\n \tOutput all merge bases for the commits, instead of just one.\n \n+--bisect-replace::\n+\tUse fixed up history from \"bisect-replace-*\" branches when\n+\tcomputing merge bases.\n+\n DISCUSSION\n ----------\n \ndiff --git a/builtin-merge-base.c b/builtin-merge-base.c\nindex 03fc1c2..31c0015 100644\n--- a/builtin-merge-base.c\n+++ b/builtin-merge-base.c\n@@ -46,9 +46,13 @@ int cmd_merge_base(int argc, const char **argv, const char *prefix)\n \tstruct commit **rev;\n \tint rev_nr = 0;\n \tint show_all = 0;\n+\tint bisect_replace = 0;\n \n \tstruct option options[] = {\n-\t\tOPT_BOOLEAN('a', \"all\", &show_all, \"outputs all common ancestors\"),\n+\t\tOPT_BOOLEAN('a', \"all\", &show_all,\n+\t\t\t    \"outputs all common ancestors\"),\n+\t\tOPT_BOOLEAN(0, \"bisect-replace\", &bisect_replace,\n+\t\t\t    \"use revs from 'bisect-replace-*' branches\"),\n \t\tOPT_END()\n \t};\n \n@@ -56,6 +60,8 @@ int cmd_merge_base(int argc, const char **argv, const char *prefix)\n \targc = parse_options(argc, argv, options, merge_base_usage, 0);\n \tif (argc < 2)\n \t\tusage_with_options(merge_base_usage, options);\n+\tif (bisect_replace)\n+\t\tbisect_replace_all();\n \trev = xmalloc(argc * sizeof(*rev));\n \twhile (argc-- > 0)\n \t\trev[rev_nr++] = get_commit_reference(*argv++);\ndiff --git a/t/t6035-bisect-replace.sh b/t/t6035-bisect-replace.sh\nindex bc07206..8fe7cc5 100755\n--- a/t/t6035-bisect-replace.sh\n+++ b/t/t6035-bisect-replace.sh\n@@ -137,6 +137,13 @@ test_expect_success '\"git rev-list --bisect-replace\" works' '\n      test_cmp rev_list.expect rev_list.output\n '\n \n+test_expect_success '\"git merge-base --bisect-replace\" works' '\n+     hash=$(git merge-base --all --bisect-replace $HASH7 $HASHFIX3) &&\n+     test \"$hash\" = \"$HASHFIX3\" &&\n+     hash=$(git merge-base --all --bisect-replace $HASH7 $HASH3) &&\n+     test \"$hash\" = \"$HASH1\"\n+'\n+\n #\n #\n test_done\n-- \n1.6.0.3.614.g0f3b9\n"}]}