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

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

From
Dietmar Winkler <dietmarw@gmx.de>
Date
Mar 4, 2011, 10:10 UTC
Message-ID
<4D70BA9C.1080902@gmx.de>
In-Reply-To
<20110303151019.GC1074@sigill.intra.peff.net>
Jeff and list,
Den 03. mars 2011 16:10, skrev Jeff King:
> I am not sure that this is a bug. The log.date parameter is about the
> log command, not necessarily other format substitutions. 

Well in http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html it says:

  "The placeholders are the same as those for the option
--pretty=format: of git-log(1), except that they need to be wrapped like
this: $Format:PLACEHOLDERS$ in the file."
And in git log the list includes (besides the various date formats) also
 %ad: author date (format respects --date= option)
  ...
 %cd: committer date *

*) actually here the string "(format respects --date= option)" is missing. Otherwise what committer date format are we speaking about ;)

So either the documentation should make clear that the substitution will *not* work or (and this would be preferable) fix the substitution so that it works as documented.

> 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.

Yes that would be even better since it would give one the freedom of defining different format for the subsitutions in different places in a project. Shame it was not accepted.

> 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.

How should this surprise people? If the used %ad they would have expected a configuration depended substitution to start with. If they wanted a log.date *independent* substitution they should have (according to the documentation) some of the other formats (e.g., %ar, %ai, ...). So I don't really see this as a reason for not fixing this bug.

/Dietmar/
Previous: Jeff KingNext: Jeff King
Message 3 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.