Show all merge-base candidates from show-branch --merge-base
This would make things easier to use for Octopus. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Sep 8, 2005 at 12:15 UTC
2f0f8b71ee45bcf91c2de480474a26030596fe3c
2 files changed
+7
-5
Documentation/git-show-branch.txt
+2
-2
@@ -33,8 +33,8 @@ OPTIONS
33
34
--merge-base::
35
Instead of showing the commit list, just act like the
36
- 'git-merge-base' command except that it can accept more
37
- than two heads.
36
+ 'git-merge-base -a' command, except that it can accept
37
+ more than two heads.
38
39
40
OUTPUT
show-branch.c
+5
-3
@@ -4,7 +4,7 @@
4
#include "refs.h"
5
6
static const char show_branch_usage[] =
7
-"git-show-branch [--all] [--heads] [--tags] [--more=count] [<refs>...]";
7
+"git-show-branch [--all] [--heads] [--tags] [--more=count] [--merge-base] [<refs>...]";
8
9
#define UNINTERESTING 01
10
@@ -291,6 +291,7 @@ static int show_merge_base(struct commit_list *seen, int num_rev)
291
{
292
int all_mask = ((1u << (REV_SHIFT + num_rev)) - 1);
293
int all_revs = all_mask & ~((1u << REV_SHIFT) - 1);
294
+ int exit_status = 1;
295
296
while (seen) {
297
struct commit *commit = pop_one_commit(&seen);
@@ -298,10 +299,11 @@ static int show_merge_base(struct commit_list *seen, int num_rev)
299
if (!(flags & UNINTERESTING) &&
300
((flags & all_revs) == all_revs)) {
301
puts(sha1_to_hex(commit->object.sha1));
301
- return 0;
302
+ exit_status = 0;
303
+ commit->object.flags |= UNINTERESTING;
304
}
305
}
304
- return 1;
306
+ return exit_status;
307
}
308
309
int main(int ac, char **av)