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

Re: [GSoC][PATCH] builtin/refs: add 'get' subcommand

From
Ben Knoble <ben.knoble@gmail.com>
Date
Sep 24, 2025, 15:29 UTC
Message-ID
<4FEB2B85-FC32-4076-9DA6-F47AAB096CB0@gmail.com>
In-Reply-To
<aNOQhncjwYCwCaZ3@pks.im>
Show 25 quoted lines
> Le 24 sept. 2025 à 02:37, Patrick Steinhardt <ps@pks.im> a écrit :
> 
> On Tue, Sep 23, 2025 at 02:50:46PM -0700, Junio C Hamano wrote:
>> Meet Soni <meetsoni3017@gmail.com> writes:
>> 
>>> While `git-rev-parse(1)` and `git-show-ref(1)` can be used to read
>>> reference values, they have drawbacks for scripting and discoverability.
>>> `rev-parse` performs DWIM expansion which is unpredictable for scripts,
>>> and `show-ref --verify` is difficult to discover and cannot read the
>>> direct target of a symbolic reference.
>> 
>> Well "refs get" is even harder to discover (it is not even in Git
>> 2.50's manual that is available everywhere on the net), so difficult
>> to discover is not a good excuse.  In a sense show-ref was invented
>> exactly to serve as something like "refs get" you are writing, so I
>> wonder if a better approach is to extend it instead of introducing
>> a new subcommand in a distant place from it?
>> 
>> Perhaps "show-ref --verify --no-deref" or something that does not
>> dereference but works directly on a symbolic ref?
> 
> For now: yes, it's more difficult to discover for sure. But users will
> adjust over time as they get more familiar with git-refs(1), and from
> thereon I think it will become significantly easier to discover that
> subcommand.
I think this goes to perhaps some of my unasked questions: who is the target audience? My experience suggest that most mostly-porcelain users don’t acquire familiarity with scripting commands, so it sounds like we’re talking about script-writers here (and in the commit message).
But how do we encourage script writers to discover these things? 🤔 Hm. 
Previous: Patrick SteinhardtNext: Junio C Hamano
Message 6 of 11 in “builtin/refs: add 'get' subcommand”
  1. Meet SoniSep 23, 2025
  2. Ben KnobleSep 23, 2025
  3. Patrick SteinhardtSep 24, 2025
  4. Junio C HamanoSep 23, 2025
  5. Patrick SteinhardtSep 24, 2025
  6. Ben KnobleSep 24, 2025
  7. Junio C HamanoSep 24, 2025
  8. Patrick SteinhardtSep 25, 2025
  9. D. Ben KnobleSep 25, 2025
  10. Junio C HamanoSep 25, 2025
  11. Patrick SteinhardtSep 24, 2025

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.