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

Re: [PATCH v2 4/4] completion: be nicer with zsh

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jan 30, 2012, 19:22 UTC
Message-ID
<CAMP44s0dU5zQLnen_DSONOum7P1UsPTASSkF1sJE2m7kAwx21A@mail.gmail.com>
In-Reply-To
<7vliopatxg.fsf@alter.siamese.dyndns.org>
2012/1/30 Junio C Hamano <gitster@pobox.com>:
Show 15 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> Felipe Contreras wrote:
>> ..., so I suppose consistency is the only reason to
>> prefer one over another.
>
> Yes. And the script may probably use [[ very heavily.
>
> Early return after || i.e.
>
>        A || return
>        B
>
> simply looks ugly and misleading, especially when the remainder B is just
> a single line.  But I stopped caring about the styles in this particular
> script long time ago, so...
What would you rather use?

[ "$__git_merge_strategies" ] && __git_merge_strategies=$(__git_list_merge_strategies)

That's 90 characters long. Although much better without the 2>/dev/null.
if [ "$__git_merge_strategies" ]; then
  __git_merge_strategies=$(__git_list_merge_strategies)
fi
That's even more lines =/
-- 
Felipe Contreras
Previous: Junio C HamanoNext: Jonathan Nieder
Message 16 of 17 in “completion: trivial cleanups”
  1. 0/4 completion: trivial cleanupsFelipe Contreras, Jan 30, 2012
  2. 2/4 completion: remove unused codeFelipe Contreras, Jan 30, 2012
  3. Jonathan NiederJan 30, 2012
  4. Junio C HamanoJan 30, 2012
  5. Jonathan NiederJan 30, 2012
  6. Junio C HamanoJan 30, 2012
  7. Junio C HamanoJan 30, 2012
  8. SZEDER GáborJan 31, 2012
  9. Jonathan NiederJan 31, 2012
  10. Jonathan NiederJan 30, 2012
  11. Felipe ContrerasJan 30, 2012
  12. Jonathan NiederJan 30, 2012
  13. Felipe ContrerasJan 30, 2012
  14. Jonathan NiederJan 30, 2012
  15. Junio C HamanoJan 30, 2012
  16. Felipe ContrerasJan 30, 2012
  17. Jonathan NiederJan 30, 2012

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.