Re: describe fails on tagless branch

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: describe fails on tagless branch

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:52

Han-Wen Nienhuys [off-list ref] writes:
Jakub Narebski escreveu:
quoted
_Which_ INIT? In git there can be more than one root commit. In git.git
I don't really care, but I would like git-describe to produce something 
useful in the absence of tags.  The -g<SHA-1> already makes the commit
uniquely identifiable.
Then you would script like this:

	#!/bin/sh
	git describe "$1" 2>/dev/null || git rev-parse --verify "$1"

I do not think it a good idea to make "git-describe" itself do
the above, as the user of describe may want to fall back on
something other than "rev-parse --verify" after ||.

Re: describe fails on tagless branch

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:42:53

[Cc: git@vger.kernel.org]

Junio C Hamano wrote:
Han-Wen Nienhuys [off-list ref] writes:
quoted
Jakub Narebski escreveu:
quoted
_Which_ INIT? In git there can be more than one root commit. In git.git
I don't really care, but I would like git-describe to produce something 
useful in the absence of tags.  The -g<SHA-1> already makes the commit
uniquely identifiable.
Then you would script like this:

      #!/bin/sh
      git describe "$1" 2>/dev/null || git rev-parse --verify "$1"

I do not think it a good idea to make "git-describe" itself do
the above, as the user of describe may want to fall back on
something other than "rev-parse --verify" after ||.
By the way, new git-describe gives us also number of commits since
tag, and it would be nice to have number of commits since init...
but that can be easily obtained using "git rev-list $1 | wc -l".

I guess that some use git-describe with --abbrev=0 to get closest
preceding tag: getting INIT would confuse them.

That said, we could use e.g. INITg2a45ba+10-g4ee2ab
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

Re: describe fails on tagless branch

From: Andy Parkins <hidden>
Date: 2016-06-15 22:42:53

On Wednesday 2007 February 07 02:14, Junio C Hamano wrote:
I do not think it a good idea to make "git-describe" itself do
the above, as the user of describe may want to fall back on
something other than "rev-parse --verify" after ||.
Agreed - the "nearest tag" mode (--abbrev=0) would be broken in that it 
git-describe would return a tag that doesn't exist.


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help