Re: kh/name-rev-custom-format
- From
- Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
- Date
- Mar 26, 2026, 19:22 UTC
- Message-ID
- <8c9dd9f9-4d41-4901-b1fb-080e4e73b40a@app.fastmail.com>
- In-Reply-To
- <xmqqtsu2pgu9.fsf@gitster.g>
On Thu, Mar 26, 2026, at 19:48, Junio C Hamano wrote:
Show 17 quoted lines
> "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes: > >> On Wed, Mar 25, 2026, at 05:20, Junio C Hamano wrote: >>> * kh/name-rev-custom-format (2026-03-20) 2 commits >>> - name-rev: learn --format=<pretty> >>> - name-rev: wrap both blocks in braces >>> >>> "git name-rev" learned to use custom format instead of the object >>> name in an extended SHA-1 expression form. >>> >>> Comments? >>> source: <V2_CV_name-rev_--format.51b@msgid.xyz> >> >> I’m working on rewriting the functionality in the form of a new builtin >> git-format-rev(1) that lives in `builtin/name-rev.c`. > > By the way, why do we want yet another builtin in the first place?
I didn’t want another builtin. I looked at the options and didn’t find anything that fit the described use case.
With git-name-rev(1) it looked like formatting options could crowd up the place.
> Wouldn't this be done as a new option to "git log", for example?
Okay with me.
git-log(1) blocks until I have closed stdin and effectively dedups the output.
git log --oneline --stdin --no-walk
HEAD
HEAD
HEAD
^D
<HEAD is listed one time>So if an option could tweak it to instead (1) give one output per line (like git-name-rev(1)) and (2) not deduplicate (well, follows from (1)) then the problem seems solved.
Thinking out loud here.