git-topic: drop merges by default
Junio C Hamano committed
Nov 13, 2007 at 01:24 UTC
f225e1a93f302f7b16463025776bd797ce6e9d82
1 file changed
+5
-2
git-topic.perl
+5
-2
@@ -11,6 +11,7 @@ my $base = 'next';
11
my @stage = qw(next pu);
12
my @mark = ('.', '?', '-', '+');
13
my $all = 0;
14
+my $merges = 0;
15
16
my @custom_stage;
17
my @custom_mark;
@@ -18,16 +19,18 @@ GetOptions("topic=s" => \$topic_pattern,
19
"base=s" => \$base,
20
"stage=s" => \@custom_stage,
21
"mark=s" => \@custom_mark,
22
+ "merges!" => \$merges,
23
"all!" => \$all)
24
or die;
25
26
if (@custom_stage) { @stage = @custom_stage; }
27
if (@custom_mark) { @mark = @custom_mark; }
28
+my @nomerges = $merges ? qw(--no-merges) : ();
29
30
sub read_revs_short {
31
my (@args) = @_;
32
my @revs;
30
- open(REVS, '-|', qw(git rev-list --no-merges), @args)
33
+ open(REVS, '-|', qw(git rev-list), @nomerges, @args)
34
or die;
35
while (<REVS>) {
36
chomp;
@@ -40,7 +43,7 @@ sub read_revs_short {
43
sub read_revs {
44
my ($bottom, $top, $mask) = @_;
45
my @revs;
43
- open(REVS, '-|', qw(git rev-list --pretty=oneline --no-merges),
46
+ open(REVS, '-|', qw(git rev-list --pretty=oneline), @nomerges,
47
"$bottom..$top")
48
or die;
49
while (<REVS>) {