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

Re: [Bug] %[a|c]d placeholder does not respect --date= option in combination with git archive

From: Jeff King <hidden>
Date: 2016-06-15 22:50:42

On Thu, Mar 03, 2011 at 10:30:16AM +0100, Dietmar Winkler wrote:
In my file I have the place holder $Format:%ad$ and in .git/config the
setting log.date = short is present.
[...]
Now if I run on the same repo
	git archive --format=zip HEAD -o out.zip
and check the place holder in the exported zip file it is actually
replaced with:

Thu, 3 Mar 2011 10:06:43 +0100

and not

2011-03-03
I am not sure that this is a bug. The log.date parameter is about the
log command, not necessarily other format substitutions. If it were any
other date format, I would say the right answer is that you should be
using one of the format-specific date specifiers. But annoyingly, there
is no such specifier for "short". Which means there is no way to
actually get the output that you want.

I remember at some point discussing extending the specifier syntax to
allow things like "%(ad,date=short)", but it was never implemented. I
think that would be the cleanest way to do what you want.

The second cleanest would be adding an archive.date variable. Which is
much simpler, obviously. But I think making "log.date" start applying to
archive substitutions is going to surprise some people and possibly
break their setups.

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