From: Kristoffer Haugsbakk Date: Thu, 26 Mar 2026 19:22:46 GMT Subject: Re: kh/name-rev-custom-format Message-ID: <8c9dd9f9-4d41-4901-b1fb-080e4e73b40a@app.fastmail.com> In-Reply-To: On Thu, Mar 26, 2026, at 19:48, Junio C Hamano wrote: > "Kristoffer Haugsbakk" 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= >>> - 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: >> >> 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 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.