git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "NODA, Kai" <nodakai@gmail.com>
To: git@vger.kernel.org
Subject: git tag --contains <commit> -n=1 ?
Date: Thu, 24 Dec 2009 01:19:51 +0900	[thread overview]
Message-ID: <4B324327.5010809@gmail.com> (raw)

Hi,
I'm thinking how to find the oldest tag containing a specified commit.
Eg.
$ cd /usr/src/linux-linus/Documentation
$ for i in *.txt; do
for> echo $i
for> hash=`git log -1 --format=format:%H -- $i`
for> git tag --contains $hash -l 'v2.6.[0-9][0-9]'|head -1
for> done
DMA-API.txt
v2.6.31
DMA-ISA-LPC.txt
v2.6.20
DMA-attributes.txt
v2.6.27
...

Here I wonder whether "head -1" is generally correct or not when I want
the oldest tag.
Moreover, as "git tag --contains ..." takes considerable time, I will
be happy if I can set the maximum number in searching tags containing
a commit.  Or are there already some (better) ways to achieve this?

Any advice is welcome.

Thanks,
Kai

             reply	other threads:[~2009-12-23 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 16:19 NODA, Kai [this message]
2009-12-23 17:19 ` git tag --contains <commit> -n=1 ? Andreas Schwab
2009-12-23 20:37   ` NODA, Kai
2009-12-24  5:52     ` Jeff King

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=4B324327.5010809@gmail.com \
    --to=nodakai@gmail.com \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).