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

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 23, 2017, 19:40 UTC
Message-ID
<xmqqr31nbx3h.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<4424eeeb-7eea-ed41-c031-ba7915cb93ab@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 14 quoted lines
>> I think René meant this:
>>
>>      /* just for side effects */
>>      skip_prefix(name, "refs/heads/", &name) ||
>>      skip_prefix(name, "refs/tags/", &name) ||
>>      skip_prefix(name, "refs/remotes/", &name);
>>
>>      return name;
>>
>> which still short-sircuits, even though I do think it looks
>> strange; "correct but strange".
>
> Yes.  At least to me it looks less strange than the same lines wrapped
> in "if ... /* nothing */".

Yup, after looking at it again, it does not look so "strange" to me. I probably should have said "unusual but correct", not "correct but strange".

Previous: René ScharfeNext: Jeff King
Message 7 of 11 in “refs.c: use skip_prefix() in prettify_refname()”
  1. refs.c: use skip_prefix() in prettify_refname()SZEDER Gábor, Mar 23, 2017
  2. René ScharfeMar 23, 2017
  3. Jeff KingMar 23, 2017
  4. Stefan BellerMar 23, 2017
  5. Junio C HamanoMar 23, 2017
  6. René ScharfeMar 23, 2017
  7. Junio C HamanoMar 23, 2017
  8. Jeff KingMar 23, 2017
  9. Junio C HamanoMar 23, 2017
  10. SZEDER GáborMar 23, 2017
  11. René ScharfeMar 23, 2017

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.