From 0aa7d4a460ba92daa87b52f0e90b5c50fa5230f2 Mon Sep 17 00:00:00 2001 From: Mark Dominus Date: Tue, 11 Dec 2012 11:51:27 -0500 Subject: [PATCH] add -q flag to git-re-edit --- git-re-edit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/git-re-edit b/git-re-edit index e4824e6..86c405e 100755 --- a/git-re-edit +++ b/git-re-edit @@ -12,17 +12,19 @@ use strict; use Getopt::Std; my %opt = ( e => $ENV{VISUAL} || $ENV{EDITOR} || "emacs", - c => 0 + c => 0, + 'q' => 0, ); -getopts('e:c', \%opt) or usage(); +getopts('e:cq', \%opt) or usage(); my $commit = shift; my @changed; if ($commit) { chomp(@changed = grep /\S/, qx{git show --pretty="format:" --name-only $commit}); } else { - chomp(@changed = grep !/^\?\? /, qx{git status --porcelain}); + chomp(@changed = qx{git status --porcelain}); exit 1 unless $? == 0; + @changed = grep !/^\?\? /, @changed unless $opt{q}; s/^.. // or die "<$_>???\n" for @changed; die "Fucking shell, how does it work?\n" if grep / /, @changed;