git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Teach/Fix pull/fetch -q/-v options

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 20, 2008, 23:54 UTC
Message-ID
<7vwsg22568.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<4ac8254d0810200935sf7ad873tea53c0fb53bbe1c0@mail.gmail.com>
"Tuncer Ayaz" <tuncer.ayaz@gmail.com> writes:
Show 22 quoted lines
> On Sun, Oct 19, 2008 at 11:26 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>>> @@ -23,6 +24,10 @@ rebase=$(git config --bool branch.$curr_branch_short.rebase)
>>>  while :
>>>  do
>>>       case "$1" in
>>> +     -q|--quiet)
>>> +             verbosity="$verbosity -q" ;;
>>> +     -v|--verbose)
>>> +             verbosity="$verbosity -v" ;;
>>
>> You know verbosity flags (-q and -v) are "the last one wins", so I do not
>> see much point in this concatenation.
>
> Without concatenation I would need to analyze the content
> of the variable each time the option is passed to the shell
> script. Do you know of a simpler/better way still keeping the
> functionality that
> $ git pull -q -v --quiet --verbose --quiet gives verbosity=QUIET
> and
> $ git pull -q -v --quiet --verbose --quiet -v yields verbosity=VERBOSE
> ?
Wouldn't
	verbosity=
	while :
        do
        	case "$1" in
                -q|--quiet) verbosity=-q ;;
                -v|--verbose) verbosity=-v ;;
		... others ...
                esac
                shift
	done
        git pull $verbosity other options
give the -q for the former and -v for the latter to "git pull"?
Previous: Tuncer AyazNext: Tuncer Ayaz
Message 4 of 5 in “Teach/Fix pull/fetch -q/-v options”
  1. Teach/Fix pull/fetch -q/-v optionsTuncer Ayaz, Oct 19, 2008
  2. Junio C HamanoOct 19, 2008
  3. Tuncer AyazOct 20, 2008
  4. Junio C HamanoOct 20, 2008
  5. Tuncer AyazOct 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.