Commit 089fdc71 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

beautify the command echoing


properly quote where necessary and space-separate, instead of
comma-separating.

Change-Id: Ibf2e638d92591700c3a26f3402f306f5995552ad
Reviewed-by: default avatarSergio Ahumada <sahumada@blackberry.com>
parent af59bb16
No related merge requests found
Showing with 7 additions and 3 deletions
...@@ -71,8 +71,7 @@ Description: ...@@ -71,8 +71,7 @@ Description:
Options: Options:
-v, --verbose -v, --verbose
Shows the alias resolving, and final 'git push' command as a Shows the alias resolving, and external command invocations.
comma-separated list of arguments.
--aliases --aliases
Reports all registered aliases. Reports all registered aliases.
...@@ -101,6 +100,11 @@ my @CCs = (); ...@@ -101,6 +100,11 @@ my @CCs = ();
my @arguments = (); my @arguments = ();
sub format_cmd(@)
{
return join(' ', map { /\s/ ? '"' . $_ . '"' : $_ } @_);
}
sub parse_arguments(@) sub parse_arguments(@)
{ {
while (scalar @_) { while (scalar @_) {
...@@ -242,7 +246,7 @@ sub push_patches() ...@@ -242,7 +246,7 @@ sub push_patches()
push @gitcmd, @arguments; push @gitcmd, @arguments;
push @gitcmd, $remote, "$ref_from:$ref_to"; push @gitcmd, $remote, "$ref_from:$ref_to";
print '+'.join(',', @gitcmd)."\n" if ($verbose); print '+ '.format_cmd(@gitcmd)."\n" if ($verbose);
exit system(@gitcmd); exit system(@gitcmd);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment