Re: [PATCH 0/4] rev-list: introduce NUL-delimited output mode
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Mar 11, 2025, 23:24 UTC
- Message-ID
- <72x6ku4jylvsnqjapqlfidq6m4yvpzu5gzpweg47phzgjg35fg@laabmtehkes4>
- In-Reply-To
- <xmqqfrjk61bb.fsf@gitster.g>
On 25/03/10 02:08PM, Junio C Hamano wrote:
Show 15 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > > > As this topic is designing essentially a new and machine parseable > > format, we could even unify all three formats into one. For example, > > the format could be like this: > > > > <oid> NUL [<attr>=<value> NUL]... > > > > where > > (0) "rev-list" that gives only a sequence of "<oid>" for commit-ish, > as well as "rev-list --boundary", would fall out as a natural > consequence. Bog-standard "list of commits" would see a > sequence of "<oid> NUL", while a boundary object would see > "<oid> NUL boundary=yes NUL".
I had not considered handling the `--boundary` option. It looks like boundary objects are printed as part of `show_commit()`, so I can adapt the handling and do something similar to missing objects:
$ git rev-list -z --boundary <rev>
<oid> NUL boundary=yes NULThis would remain consistent with the unified format.
-Justin