Thread (6 messages) flat view 6 messages, 5 authors, 2016-06-15

Re: [PATCH 0/2] Use %as and %cs as pretty format flags

From: Nathan W. Panike <hidden>
Date: 2016-06-15 22:45:15

Possibly related (same subject, not in this thread)

On Thu, Aug 28, 2008 at 6:54 PM, Jeff King [off-list ref] wrote:
On Thu, Aug 28, 2008 at 04:36:51PM -0700, Junio C Hamano wrote:
quoted
I was actually thinking about rejecting this, asking for something that
allows to express all the other %[ai][dDri] format can express, and
perhaps more.  So I think "%ad(short)" is a good direction to go, except
that 'd' is already taken.  Perhaps %a(date), %a(shortdate,local),...?
I was thinking we could accept %ad _or_ %ad(short), but of course
introducing the latter can break existing "%ad(my other random text)"
which is a bad idea.

I really think some consideration should be given to introducing
arbitrary "arguments" to formatting specifiers, of which this is one
example. Another that has been mentioned is pulling an arbitrary element
from a list.

How do you feel about a brand new syntax (and supporting the old, of
course) that is syntactically a little easier to extend. Like:

 %(macro, key=val, key=val)

e.g.

 %(authordate, format=short, tz=local)
The genesis of this patch was the documentation says that %ad
represents 'author date' without any more specific information.  I
thought that I could do

git show --date=short --pretty=format:"%ad %h"

and get the date in short form---but alas, this did not work.  So I
wrote up the patch to get a short date format.  Your ideas are much
more powerful.  I like them.

Thanks for git.

Nathan Panike
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help