Teach/Fix pull/fetch -q/-v options
Implement git-pull --quiet and git-pull --verbose by adding the options to git-pull and fixing verbosity handling in git-fetch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
a0d3ab9c27
commit
7f87aff22c
@ -484,6 +484,28 @@ int parse_opt_approxidate_cb(const struct option *opt, const char *arg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
|
||||
int unset)
|
||||
{
|
||||
int *target = opt->value;
|
||||
|
||||
if (unset)
|
||||
/* --no-quiet, --no-verbose */
|
||||
*target = 0;
|
||||
else if (opt->short_name == 'v') {
|
||||
if (*target >= 0)
|
||||
(*target)++;
|
||||
else
|
||||
*target = 1;
|
||||
} else {
|
||||
if (*target <= 0)
|
||||
(*target)--;
|
||||
else
|
||||
*target = -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This should really be OPTION_FILENAME type as a part of
|
||||
* parse_options that take prefix to do this while parsing.
|
||||
|
||||
Reference in New Issue
Block a user