Re: [PATCH/RFC] pretty.c: add %O format specifier to format_commit_one()
- From
Jeff King <peff@peff.net>
- Date
- May 2, 2010, 04:55 UTC
- Message-ID
- <20100502045552.GC14776@coredump.intra.peff.net>
- In-Reply-To
- <7vsk6b5yms.fsf@alter.siamese.dyndns.org>
On Sat, May 01, 2010 at 10:18:35AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> Alexander Shishkin <ash@koowaldah.org> writes: > > > This specifier represents the number of each commit in the output > > stream. > > I don't like this. What does such a number _mean_ in a non-linear > history? > > Also the next person who sees this will inevitably ask for %TOTAL to so > that the output can say [N/M], but that would mean the list has to be > limited and we cannot stream the output anymore.
Hmph. I started on a patch a while ago (but never finished) that would allow an [N/M] output. My intent was to allow pretty-format specifiers for generating cover letters[1].
Of course you can't stream when asking for %TOTAL, but that is already the case with format-patch, which does such a calculation when numbering patch subjects. We could use userformat_find_requirements to do the lookup when needed, and then only formats which use the placeholder would have to pay the penalty.
-Peff
[1] These days I do:
git format-patch --stdout "$@" |
sed -ne 's/^Subject: //p' |
sed -e 's/\[PATCH /[/' \
-e 's/]/]:/' \
-e 's/^/ /'and pull the result into a cover letter that I write manually.