Re: [PATCH 8/9] for-each-ref: add option to fully dereference tags
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 8, 2023, 03:14 UTC
- Message-ID
- <xmqq4jhx7x8l.fsf@gitster.g>
- In-Reply-To
- <cf691b7c-288f-4cc9-a2ac-1a43972ae446@github.com>
Victoria Dye <vdye@github.com> writes:
> I think `^{}fieldname` would be a good candidate, but it's *extremely*Gaah. Why? fieldname^{} I may understand, but in the prefix form?In any case, has anybody considered that we may be better off to declare that "*field" peeling a tag only once is a longstanding bug?
IOW, can we not add "fully peel" command line option or a new syntax and instead just "fix" the bug to fully peel when "*field" is asked for?
An application that cares about handling a chain of annotatetd tags would want to be able to say "this is the outermost tag's information; one level down, the tag was signed by this person; another level down, the tag was signed by this person, etc." which would mean either
* we have a syntax that shows the information from all levels (e.g., "**taggername" may say "Victoria\nPatrick\nGitster")
* we have a syntax that allows to specify how many levels to peel, (e.g., "*0*taggername" may be the same as "taggername", "*1*taggername" may be the same as "*taggername") plus some programming construct like variables and loops.
but the repertoire being proposed that consists only of "peel only once" and "peel all levels" is way too insufficient.
Note that I do not advocate for allowing inspection of each levels separately. Quite the contrary. I would say that --format=<> placeholder should not be a programming language to satisify such a niche need. And my conclusion from that stance is "peel once" plus "peel all" are already one level too many, and "peel once" was a very flawed implementation from day one, when 9f613ddd (Add git-for-each-ref: helper for language bindings, 2006-09-15) introduced it.