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
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 (<REVS>) {
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 (<REVS>) {