From: Junio C Hamano Date: Tue, 13 Nov 2007 09:24:58 +0000 (-0800) Subject: git-topic: drop merges by default X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f225e1a93f302f7b16463025776bd797ce6e9d82;p=thirdparty%2Fgit.git git-topic: drop merges by default --- diff --git a/git-topic.perl b/git-topic.perl index 40e16d3475..f875d0d5d8 100755 --- a/git-topic.perl +++ b/git-topic.perl @@ -11,6 +11,7 @@ my $base = 'next'; my @stage = qw(next pu); my @mark = ('.', '?', '-', '+'); my $all = 0; +my $merges = 0; my @custom_stage; my @custom_mark; @@ -18,16 +19,18 @@ GetOptions("topic=s" => \$topic_pattern, "base=s" => \$base, "stage=s" => \@custom_stage, "mark=s" => \@custom_mark, + "merges!" => \$merges, "all!" => \$all) or die; if (@custom_stage) { @stage = @custom_stage; } if (@custom_mark) { @mark = @custom_mark; } +my @nomerges = $merges ? qw(--no-merges) : (); sub read_revs_short { my (@args) = @_; my @revs; - open(REVS, '-|', qw(git rev-list --no-merges), @args) + open(REVS, '-|', qw(git rev-list), @nomerges, @args) or die; while () { chomp; @@ -40,7 +43,7 @@ sub read_revs_short { sub read_revs { my ($bottom, $top, $mask) = @_; my @revs; - open(REVS, '-|', qw(git rev-list --pretty=oneline --no-merges), + open(REVS, '-|', qw(git rev-list --pretty=oneline), @nomerges, "$bottom..$top") or die; while () {