Thread (1 message) 1 message, 1 author, 2016-06-15

Re: `git describe` in an export-subst format string?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:03

Junio C Hamano [off-list ref] writes:
John Gallagher [off-list ref] writes:
quoted
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 ;-).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help