Git development
 help / color / mirror / Atom feed
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 14:32:07 -0700	[thread overview]
Message-ID: <7vobcypciw.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAFoDJR8RQExLwXcrViAJpWgvq+wBopY-Wq1keHxVqB3QwtAz4A@mail.gmail.com> (John Gallagher's message of "Sun, 28 Apr 2013 14:02:04 -0400")

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

  reply	other threads:[~2013-04-28 21:32 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 [this message]
2013-04-28 22:52   ` Junio C Hamano

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