Re: [PATCH v6 1/3] ls-refs: report unborn targets of symrefs
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Feb 2, 2021, 18:34 UTC
- Message-ID
- <20210202183453.1907985-1-jonathantanmy@google.com>
- In-Reply-To
- <xmqq4kiuif4d.fsf@gitster.c.googlers.com>
Show 18 quoted lines
> > diff --git a/Documentation/technical/protocol-v2.txt b/Documentation/technical/protocol-v2.txt > > index 85daeb5d9e..4707511c10 100644 > > --- a/Documentation/technical/protocol-v2.txt > > +++ b/Documentation/technical/protocol-v2.txt > > @@ -192,11 +192,19 @@ ls-refs takes in the following arguments: > > When specified, only references having a prefix matching one of > > the provided prefixes are displayed. > > > > +If the 'unborn' feature is advertised the following argument can be > > +included in the client's request. > > + > > + unborn > > + The server may send symrefs pointing to unborn branches in the form > > + "unborn <refname> symref-target:<target>". > > + > > I somehow had an impression that this is done only for HEAD and no > other symrefs.
Right now, that's true.
Show 7 quoted lines
> If this describes the ideal endgame state and the implementation at > the moment only covers what is practically the most useful (i.e. > HEAD), that is fine. > > If we do not plan to support symrefs other than HEAD that are > dangling, that is fine as well, but then the description needs > updating, no?
I'm not sure what the ideal endgame state is, but I could see how sending all symlinks would be useful (e.g. if a client wanted to mirror another repo with more fidelity). Right now I don't plan on adding support for dangling symrefs other than HEAD, though. Maybe I'll update it to something like:
If HEAD is a symref pointing to an unborn branch, the server may send it in the form "unborn HEAD symref-target:<target>". In the future, this may be extended to other symrefs as well.
I think that there is a discussion point to be decided (advertise/allow/ignore vs allow/ignore), so I'll wait for that before sending v7.