git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Dietmar Winkler <dietmarw@gmx.de>
Date
Mar 3, 2011, 09:30 UTC
Message-ID
<4D6F5FA8.5030105@gmx.de>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It seems like that the place holders %ad and %cd do not respect the
- --date= option when used as part of the export substitution.

In my file I have the place holder $Format:%ad$ and in .git/config the setting log.date = short is present.

I can very this the date setting by running
	git log --pretty=format:%ad
and I get:
2011-03-03
2011-02-28
2011-02-28
2011-02-28
2011-02-28
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
The same happens with the place holder %cd
/Dietmar/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iJwEAQECAAYFAk1vX6gACgkQCXG8gXafJGFfHwQApYJ/y0bS0D97fMKGjjBjjZQv sOrPbwxIaPII2RGeRqxlQLjDL2kYnXHObTor+3rLWbNHLXPjjPw/2r4YIeCxz/f+ vA8ro9o4dTAyvGiUc/xUhu/U4XaVuV4Rl3QX83oaGmuefHRGc5/esex4R4mnzVdW QBPVvqqs25gyiu7zV6s= =lVtM -----END PGP SIGNATURE-----

Next: Jeff King
Message 1 of 15 in “[Bug] %[a|c]d placeholder does not respect --date= option in combination with git archive”
  1. Dietmar WinklerMar 3, 2011
  2. Jeff KingMar 3, 2011
  3. Dietmar WinklerMar 4, 2011
  4. Jeff KingMar 5, 2011
  5. 1/2 pretty.c: give format_person_part the whole placeholderJeff King, Mar 5, 2011
  6. 2/2 pretty.c: allow date formats in user format stringsJeff King, Mar 5, 2011
  7. Fwd: [PATCH 2/2] pretty.c: allow date formats in user format stringsWill Palmer, Mar 6, 2011
  8. Jeff KingMar 7, 2011
  9. Will PalmerMar 7, 2011
  10. Will PalmerMar 7, 2011
  11. Jeff KingMar 7, 2011
  12. Will PalmerMar 8, 2011
  13. Junio C HamanoMar 9, 2011
  14. Jeff KingMar 10, 2011
  15. Dietmar WinklerMar 11, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.