Introduce a new command to work with refs
Paraphrasing @pks-gitlab from the mailing list: https://lore.kernel.org/git/ZkNJaaKTTKbns8wo@tanuki/#t
> * for-each-ref, show-ref
> These two commands do very similar things, i.e. list references. Both
> diverge in the features they provided, but its not clear why we have the
> two.
True, they have clear overlap and both are part of plumbing. I never
quite know which one to pick. But git-show-ref(1) handles things that
git-for-each-ref(1) doesn't ("--exists", "--verify") and the other way
round ("--stdin", "--sort=", many more).
Honestly, I think that both of these are not ideal. I think we should
think bigger in this context and introduce a new command with proper
subcommands to make the whole story around refs more coherent and
discoverable:
# Replaces git-show-ref(1) and git-for-each-ref(1).
$ git refs list
# Replaces `git show-ref --exists`.
$ git refs exist
# Replaces `git show-ref --verify <ref>`.
$ git refs show
# Replaces git-symbolic-ref(1) to show a ref.
$ git refs resolve
# Replaces git-pack-ref(1).
$ git refs pack
# Replaces git-update-ref(1).
$ git refs write
# Replaces git-check-ref-format(1).
$ git refs check-format
This is of course a much larger topic and something that is very much up
for discussion. But in any case, it indicates that a deprecation would
be premature at this point in time.