git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-archive doesn't support --date= option for %ad & %cd format:<string>'s
@ 2014-10-09 16:19 Derek Moore
  2014-10-09 19:24 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Derek Moore @ 2014-10-09 16:19 UTC (permalink / raw)
  To: git

PRETTY FORMATS' format:<string> documentation says, "%ad: author date
(format respects --date= option)", and similarly for %cd.

But git-archive does not support the --date= option for changing the
date format in $Format:%ad$ or $Format:%cd$ substitution strings.


Relatedly, I want a short RFC date, not a short ISO date, but there is
only --date=short, which is ISO.

Would introducing --date=shortrfc and --date=shortiso be feasable,
with --date=short aliasing to --date=shortiso. With a shortrfc, I
could recreate SVN $Date$'s, which would be equivalent to $Format:%ai
(%ad)$ when used with "git archive --date=shortrfc".

Thanks,

Derek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-archive doesn't support --date= option for %ad & %cd format:<string>'s
  2014-10-09 16:19 git-archive doesn't support --date= option for %ad & %cd format:<string>'s Derek Moore
@ 2014-10-09 19:24 ` Jeff King
  2014-10-09 19:27   ` Jeff King
  2014-10-09 19:30   ` Derek Moore
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff King @ 2014-10-09 19:24 UTC (permalink / raw)
  To: Derek Moore; +Cc: git

On Thu, Oct 09, 2014 at 11:19:36AM -0500, Derek Moore wrote:

> PRETTY FORMATS' format:<string> documentation says, "%ad: author date
> (format respects --date= option)", and similarly for %cd.
> 
> But git-archive does not support the --date= option for changing the
> date format in $Format:%ad$ or $Format:%cd$ substitution strings.

Correct. You can use %ai, %aD, etc to pick a format. But...

> Relatedly, I want a short RFC date, not a short ISO date, but there is
> only --date=short, which is ISO.

If you start adding new formats, we are likely going to run out of
reasonably-memorable letters.

We've discussed something like "%ad(rfc822)" in the past, and I even had
a patch:

  http://article.gmane.org/gmane.comp.version-control.git/168512

but it got bogged down in a discussion on potentially expanding the
placeholder syntax to something more regular (probably
"%(authordate:rfc822"), like for-each-ref does. That's from 2011, and I
doubt anybody is working on it now.

> Would introducing --date=shortrfc and --date=shortiso be feasable,
> with --date=short aliasing to --date=shortiso. With a shortrfc, I
> could recreate SVN $Date$'s, which would be equivalent to $Format:%ai
> (%ad)$ when used with "git archive --date=shortrfc".

I don't see a big problem with that. But I wonder if we would do better
to introduce arbitrary strftime-like formatting, so we do not have to
keep adding new formats.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-archive doesn't support --date= option for %ad & %cd format:<string>'s
  2014-10-09 19:24 ` Jeff King
@ 2014-10-09 19:27   ` Jeff King
  2014-10-09 19:30   ` Derek Moore
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff King @ 2014-10-09 19:27 UTC (permalink / raw)
  To: Derek Moore; +Cc: git

On Thu, Oct 09, 2014 at 03:24:28PM -0400, Jeff King wrote:

> On Thu, Oct 09, 2014 at 11:19:36AM -0500, Derek Moore wrote:
> 
> > PRETTY FORMATS' format:<string> documentation says, "%ad: author date
> > (format respects --date= option)", and similarly for %cd.
> > 
> > But git-archive does not support the --date= option for changing the
> > date format in $Format:%ad$ or $Format:%cd$ substitution strings.
> 
> Correct. You can use %ai, %aD, etc to pick a format. But...
> 
> > Relatedly, I want a short RFC date, not a short ISO date, but there is
> > only --date=short, which is ISO.
> 
> If you start adding new formats, we are likely going to run out of
> reasonably-memorable letters.
> [...]

I meant to add in here: ...so an external "--date" option does not seem
like that bad an idea. I think calling it "--date" is probably a
mistake, but something like "--subst-date-format" or something might
make more sense.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-archive doesn't support --date= option for %ad & %cd format:<string>'s
  2014-10-09 19:24 ` Jeff King
  2014-10-09 19:27   ` Jeff King
@ 2014-10-09 19:30   ` Derek Moore
  1 sibling, 0 replies; 4+ messages in thread
From: Derek Moore @ 2014-10-09 19:30 UTC (permalink / raw)
  To: Jeff King; +Cc: git

> I don't see a big problem with that. But I wonder if we would do better
> to introduce arbitrary strftime-like formatting, so we do not have to
> keep adding new formats.

My thoughts exactly...

This list seems to be a prove-yourself-with-patches sorta place. If I
can find the time, I'll try attacking this also in some manner.

Thanks again,

Derek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-09 19:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09 16:19 git-archive doesn't support --date= option for %ad & %cd format:<string>'s Derek Moore
2014-10-09 19:24 ` Jeff King
2014-10-09 19:27   ` Jeff King
2014-10-09 19:30   ` Derek Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).