Re: [PATCH 08/15] for-each-ref: get --pretty using format_commit_message
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 5, 2013, 13:21 UTC
- Message-ID
- <CACsJy8ABwroExpXQRX8OYAnDum9+sX1+JB9z+WNn+YcZoXi5KA@mail.gmail.com>
- In-Reply-To
- <CAPig+cRmnc=poOZUxZms_OWdLpBM_q=h+MDYisu8WtuF11PYXA@mail.gmail.com>
On Wed, Jun 5, 2013 at 4:12 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 10 quoted lines
>> +Caveats: >> + >> +1. Many of the placeholders in "PRETTY FORMATS" are designed to work >> + specifically on commit objects: when non-commit objects are >> + supplied, those placeholders won't work. > > Should "won't work" be expanded upon? It's not clear if this means > that git will outright crash, or if it will abort with an appropriate > error message, or if the directive will be displayed as-is or removed > from the output.
It will be displayed as-is but that's a bit inconsistent: %(unknown) prints error and aborts while %unknown simply produces %unknown. The latter is how "git log --format" does it. But I think we could make for-each-ref --pretty to do the former for %unknown. It'll be consistent with %(unknown) and we do not need to elaborate much (it's pretty obvious when it does not work). -- Duy