From: Junio C Hamano <gitster@pobox.com>
To: John Gallagher <johnkgallagher@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: `git describe` in an export-subst format string?
Date: Sun, 28 Apr 2013 15:52:20 -0700 [thread overview]
Message-ID: <7vbo8yp8t7.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vobcypciw.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 28 Apr 2013 14:32:07 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> John Gallagher <johnkgallagher@gmail.com> writes:
>
>> The actual thing I want to do is
>> something like this:
>>
>> static const char *project_version = "$Format:...$";
>>
>> where "..." is something that `git archive` will replace with the
>> output of `git describe`,...
>
> You need to find an appropriate pair of placeholders that can
> represent "git describe $it" and "git describe --contains $it".
>
> I am tempted to suggest a more generalized way that is not limited
> to describe at all, perhaps like this:
>
> $ git show --format='%x( git describe %H )'
> $ git show --format='%x( git describe --contains %H )'
Just in case anybody takes it too seriously, this particular
implementaiton will never be acceptable at least for use in
"$Format:" of export-subst.
I am "tempted to" suggest, but am not crazy enough to actually doing
so ;-).
prev parent reply other threads:[~2013-04-28 22:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-28 18:02 `git describe` in an export-subst format string? John Gallagher
2013-04-28 21:32 ` Junio C Hamano
2013-04-28 22:52 ` Junio C Hamano [this message]
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=7vbo8yp8t7.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johnkgallagher@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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