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

Re: [PATCH] show-ref: place angle brackets around variables in usage string

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 31, 2015, 16:33 UTC
Message-ID
<xmqq8u8rxvss.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqd1y3xx3f.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
>>> - N_("git show-ref --exclude-existing[=pattern] < ref-list"),
>>> + N_("git show-ref --exclude-existing[=<pattern>] < <ref-list>"),
>>
>> Should the '<' stdin redirection be shown?
>
> Hmm, that actually is an interesting thought,...

Having said all that (i.e. I agree dropping "< $anything" may be a good idea in general), for this particular command, I suspect that the feature may have outlived its usefulness. It was introduced (silently) in ed9f7c95 (git-fetch: Avoid reading packed refs over and over again, 2006-12-17) as an optimisation that is very specific to the way how "git fetch" scripted Porcelain happened to be written back then.

The way the feature is misdesigned clearly shows that it was not designed for general consumption---if it were, we would have made "show-ref" to be usable as a filter even when we are not excluding anything with "--exclude-existing" option.

Of course, it is OK and definitely a lot safer to keep the "can work as a filter" feature for possible third-party uses, but if we were to go that route, it is not too late to extend the machinery so that "work as a filter" is not tied too closely to "exclude-existing".

Previous: Junio C Hamano
Message 5 of 5 in “show-ref: place angle brackets around variables in usage string”
  1. show-ref: place angle brackets around variables in usage stringAlex Henrie, Aug 29, 2015
  2. Philip OakleyAug 29, 2015
  3. Alex HenrieAug 29, 2015
  4. Junio C HamanoAug 31, 2015
  5. Junio C HamanoAug 31, 2015

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.