From: Michael J Gruber <git@drmicha•warpmail.net>
To: Josh Triplett <josh@joshtriplett•org>, git@vger•kernel.org
Subject: Re: Pretty format specifier for commit count?
Date: Mon, 19 Jan 2015 14:54:13 +0100 [thread overview]
Message-ID: <54BD0C85.1070001@drmicha.warpmail.net> (raw)
In-Reply-To: <20150119012926.GA24004@thin>
Josh Triplett schrieb am 19.01.2015 um 02:29:
> 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
>
Can you be a bit more specific about the type count that you are after?
"git describe" counts commits since the most recent tag (possibly within
a specific subset of all tags). Is that your desired format?
(I won't suggest scripting around rev-list, describe and log -1 because
you know that already...)
Michael
next prev parent reply other threads:[~2015-01-19 13:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 1:29 Pretty format specifier for commit count? Josh Triplett
2015-01-19 13:54 ` Michael J Gruber [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54BD0C85.1070001@drmicha.warpmail.net \
--to=git@drmicha$(echo .)warpmail.net \
--cc=git@vger$(echo .)kernel.org \
--cc=josh@joshtriplett$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox