Re: [PATCH v3] update-ref: add --rename option
On Mon, Jun 15, 2026 at 10:03:32AM -0700, Junio C Hamano wrote:
Show 30 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> > On Fri, Jun 12, 2026 at 08:41:48AM -0700, Junio C Hamano wrote:
> >> Patrick Steinhardt <ps@pks.im> writes:
> >>
> >> > A slight tangent: this is part of why I really don't like commands that
> >> > determine their mode via flags: you now have to worry about every
> >> > combination of flags and whether they even make sense. With subcommands
> >> > we at least only have to worry about the set of flags that directly
> >> > apply to that given subcommand.
> >> >
> >> > Makes me wonder whether I should have a look at extending git-refs(1)
> >> > further:
> >> >
> >> > git refs delete <ref> [<oldvalue>]
> >> > git refs update <ref> <newvalue> [<oldvalue>]
> >> > git refs rename <ref> <oldname> <newname>
> >> >
> >> > I always wanted to do this eventually so that we have one top-level
> >> > command that knows how to do "everything refs".
> >>
> >> That may indeed be a better direction to go, but isn't update-ref
> >> the "everything refs" command already?
> >
> > Well, it doesn't handle reading references, which is something that
> > git-refs(1) already knows to do.
>
> OK, fair enough. "git refs" should become superset of "git
> show-ref" and "git update-ref", I guess.
>
> So do you want to take the topic over and add it to "git refs"?
Sure, I can do that.
Patrick