Re: git tag --contains <commit> -n=1 ?

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

Re: git tag --contains <commit> -n=1 ?

From: Andreas Schwab <hidden>
Date: 2016-06-15 22:47:56

"NODA, Kai" [off-list ref] writes:
Here I wonder whether "head -1" is generally correct or not when I want
the oldest tag.
Since the output of git tag is sorted by name, generally not.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Re: git tag --contains <commit> -n=1 ?

From: NODA, Kai <hidden>
Date: 2016-06-15 22:47:56

Thank you for your reply, Andreas

Andreas Schwab wrote:
...
quoted
Here I wonder whether "head -1" is generally correct or not when I want
the oldest tag.
Since the output of git tag is sorted by name, generally not.
Wow, I didn't know that.
But then, under the assumption that tags have names like verNNN,
that behavior ensures me that "head -1" works as intended.

Maybe I look at its implementation ( refs.c:do_for_each_ref , right?)
but this seems a tough code to comprehend, especially around
packed/loose/extra ...

Thanks,
Kai

Re: git tag --contains <commit> -n=1 ?

From: Jeff King <hidden>
Date: 2016-06-15 22:47:56

On Thu, Dec 24, 2009 at 05:37:35AM +0900, NODA, Kai wrote:
quoted
Since the output of git tag is sorted by name, generally not.
Wow, I didn't know that.
But then, under the assumption that tags have names like verNNN,
that behavior ensures me that "head -1" works as intended.
If that assumption does not hold, you can also sort by date. See:

  http://article.gmane.org/gmane.comp.version-control.git/133586

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help