git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pretty format specifier for commit count?
@ 2015-01-19  1:29 Josh Triplett
  2015-01-19 13:54 ` Michael J Gruber
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Triplett @ 2015-01-19  1:29 UTC (permalink / raw)
  To: git

I'd like to use git-log to generate a Debian changelog file (with one
entry per commit), which has entries like this:

package-name (version-number) unstable; urgency=low

 * ...

 -- Example Person <person@example.org>  RFC822-date

Since I'm intentionally generating one entry per commit, I can generate
*almost* all of this with git log:

git log --pretty='format:packagename (FIXME) unstable; urgency=low%n%n  * %s%n%w(0,4,4)%+b%w(0,0,0)%n -- %an <%ae>  %aD%n'

This produces entries like this:

packagename (FIXME) unstable; urgency=low

  * Example change

    Long description of example change.

 -- Josh Triplett <josh@joshtriplett.org>  Thu, 8 Jan 2015 16:36:52 -0800

packagename (FIXME) unstable; urgency=low

  * Initial version

 -- Josh Triplett <josh@joshtriplett.org>  Thu, 8 Jan 2015 16:36:51 -0800

Would it be possible to add a format specifier producing a commit count,
similar to that provided by git-describe?  Such a specifier would allow
filling in the version number in the format above (replacing the FIXME).
(Note that the version numbers need to monotonically increase; otherwise
I would just use the commit hash as the version numer.)

- Josh Triplett

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

end of thread, other threads:[~2015-01-22 12:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19  1:29 Pretty format specifier for commit count? Josh Triplett
2015-01-19 13:54 ` Michael J Gruber
2015-01-20  1:17   ` Josh Triplett
2015-01-20 21:49     ` Jeff King
2015-01-20 23:11       ` josh
2015-01-22 10:10         ` Michael J Gruber
2015-01-22 12:52           ` Jeff King

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