Skip to content

Commit

Permalink
Add config settings for common options
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmv committed Mar 31, 2010
1 parent 090072f commit e60b7b2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions git-sync
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ value.
=item C<--verbose> or C<-v>
Be more verbose about which repositories are skipped, and why.
Be more verbose about which repositories are skipped, and why. This
option's default is controlled by the C<sync.verbose> key in
F<.gitconfig>
=item C<--quiet> or C<--terse> or C<-q>
Skip the display of non-dirty, up-to-date repositories.
Skip the display of non-dirty, up-to-date repositories. This option's
default is controlled bt the C<sync.quiet> key in F<.gitconfig>
=item C<--pretend> or C<--dry-run> or C<-n>
Expand All @@ -150,7 +153,8 @@ L</Github> and L</Remote> directories.
When a repository is ahead or behind its tracking remote (but not
diverged), show the output of C<git log --oneline --reverse> for the
list of commits that differ.
list of commits that differ. This option's default is controlled by
the C<sync.log> key in F<.gitconfig>
=item C<--help> or C<-h>
Expand Down Expand Up @@ -198,7 +202,7 @@ GetOptions(
'verbose|v!' => \$verbose,
'quiet|terse|q!' => \$quiet,
'pretend|dry-run|n' => \$pretend,
'log|l' => \$log,
'log|l!' => \$log,
'help|h' => \$help,
) or pod2usage( -verbose => 1 );

Expand All @@ -211,6 +215,9 @@ $verbose = -$quiet if defined $quiet;

my %sync;
for (split /\0/, `git config -z --get-regexp ^sync\\\\.`) {
$verbose = 1 if not defined $verbose and $_ eq "sync.verbose";
$verbose = -1 if not defined $verbose and $_ eq "sync.quiet";
$log = 1 if not defined $log and $_ eq "sync.log";
next unless /^sync\.(.*?)\.([^\n]*)(?:\n(.*))?/;
$sync{$1}{$2} = exists $sync{$1}{$2}
? ref $sync{$1}{$2} ? [@{$sync{$1}{$2}}, $3] : [$sync{$1}{$2}, $3]
Expand Down

0 comments on commit e60b7b2

Please sign in to comment.