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

From: Junio C Hamano <[email-masked]>
Date: Tue, 23 Sep 2025 14:50:46 -0700

Meet Soni <[email-masked]> 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?