Skip to content

Commit

Permalink
add -q flag to git-re-edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dominus committed Jan 1, 2013
1 parent 4aa5476 commit 0aa7d4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions git-re-edit
Expand Up @@ -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;
Expand Down

0 comments on commit 0aa7d4a

Please sign in to comment.