Re: [PATCH v5 3/3] cat-file: add --follow-symlinks to --batch
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 14, 2015, 20:06 UTC
- Message-ID
- <xmqqiobukjow.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1431455779.16652.20.camel@ubuntu>
David Turner <dturner@twopensource.com> writes:
Show 10 quoted lines
> On Tue, 2015-05-12 at 11:07 -0700, Junio C Hamano wrote: > >> * Is it fundamental that this is only for --batch family, or is it >> just lack of need by the current implementor and implementation? >> "git cat-file --follow-symlinks blob :RelNotes" does not sound >> a nonsense request to me. > > The reason that --follow-symlinks doesn't work for non-batch requests is > that it is impossible to distinguish out-of-tree symlinks from valid > output in non-batch output. I will add text explaining this.
Actually, I do not think that is a valid reason not to consider supporting "git cat-file --follow-symlinks blob :RelNotes" in future versions of Git. "--batch" and "--batch-check" needs to continue, so it needs to give diagnosis in-line in its output and let the driving script continue talking with it, but a single-shot request "git cat-file --follow-symlinks blob :RelNotes" can signal that the link does not resolve in-tree (or in-index) by erroring out.
So I still view it as "we currently do not need it outside --batch; if somebody wants to, feel free to add it to non-batch mode". It does not have to be called a bug but I would say it is a missing feature. And not handling an in-index path e.g. :RelNotes falls into the same category, I would say.
Just to avoid misunderstanding, I still think this series (at its 9th iteration) is good from the point of new feature without filling these two missing features.