From: Junio C Hamano Date: Sun, 28 Apr 2013 21:32:07 GMT Subject: Re: `git describe` in an export-subst format string? Message-ID: <7vobcypciw.fsf@alter.siamese.dyndns.org> In-Reply-To: John Gallagher 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 )'