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

Re: [PATCHv2 10/19] git-submodule.sh: convert test -a/-o to && and ||

From
Johannes Sixt <j.sixt@viscovery.net>
Date
May 22, 2014, 09:10 UTC
Message-ID
<537DBEEA.8010403@viscovery.net>
In-Reply-To
<CA+EOSB=wqBUb_QB6XtK0v4Lsux1mG7wCvXP3XVeDe7o=ofsYFA@mail.gmail.com>
Am 5/22/2014 10:38, schrieb Elia Pinto:
Show 19 quoted lines
> 2014-05-22 8:49 GMT+02:00 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>:
>> Elia Pinto <gitter.spiros@gmail.com> writes:
>>> @@ -1059,13 +1059,17 @@ cmd_summary() {
>>>               while read mod_src mod_dst sha1_src sha1_dst status sm_path
>>>               do
>>>                       # Always show modules deleted or type-changed (blob<->module)
>>> -                     test $status = D -o $status = T && echo "$sm_path" && continue
>>> +                     case "$status" in
>>> +                     [DT])
>>> +                             printf '%s\n' "$sm_path" &&
>>> +                             continue
>>> +                     esac
>>
>> turning a echo into a printf is good, but would be better done
>> separately.
> 
> I had thought, but the change was in the fix of Johannes, and it did
> not think was right to change this, especially that it was right
> anyway. But I understand very well the observation.

My intent was to show the final state of this piece of code. I do agree with Matthieu that the change from 'echo' to 'printf' is a different topic (in particular, since this is not the only point in the script that would need that change). Sorry for having sent you in circles.

-- Hannes
Previous: Elia Pinto
Message 4 of 4 in “[PATCHv2 10/19] git-submodule.sh: convert test -a/-o to && and ||”
  1. Elia PintoMay 21, 2014
  2. Matthieu MoyMay 22, 2014
  3. Elia PintoMay 22, 2014
  4. Johannes SixtMay 22, 2014

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.