# Re: small git lesson [Was: Re: Revert 737a3bb9416ce2a7c7a4170852473a4fcc9c67e8 ?]

1 messages from 2011-04-13 to 2011-04-13. Participants: Uwe Kleine-König.
Thread: https://gitlist.dev/t/27082

## Uwe Kleine-König, 2011-04-13 09:36

Subject: Re: small git lesson [Was: Re: Revert 737a3bb9416ce2a7c7a4170852473a4fcc9c67e8 ?]
Message-ID: <20110413093608.GO18850@pengutronix.de>
URL: https://gitlist.dev/e/20110413093608.GO18850%40pengutronix.de
In-Reply-To: <m339lm8r31.fsf@redhat.com>

```
Hello,

On Wed, Apr 13, 2011 at 10:59:14AM +0200, Andreas Schwab wrote:
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> 
> > $ git name-rev --refs=refs/tags/v2.6\* 69a07f0b117a40fcc1a479358d8e1f41793617f2
> > 69a07f0b117a40fcc1a479358d8e1f41793617f2 tags/v2.6.39-rc2~3^2~43^2~4
> >
> > so it was introduced just before -rc2.
> 
> $ git tag --contains 69a07f0b117a40fcc1a479358d8e1f41793617f2
> v2.6.39-rc1
> v2.6.39-rc2
huh, I thought git name-rev prefers old[1] refs (similar to describe
prefering newer).

$ for rc in 1 2; do git name-rev --refs=refs/tags/v2.6.39-rc$rc 69a07f0b1; done
69a07f0b1 tags/v2.6.39-rc1~79^2~31^2~4
69a07f0b1 tags/v2.6.39-rc2~3^2~43^2~4

I would prefer the v2.6.39-rc1 name even though it's nearer[1] at
v2.6.39-rc2.

If it should stay as is, what is the best way to find out the oldest
tag?
 
Best regards
Uwe

[1] as in minimizing

	git rev-list 69a07f0b117a..$ref | wc -l

(v2.6.39-rc1 -> 21281; v2.6.39-rc2 -> 21608)

[2] as in minimizing the number of traversing a parent link.

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

```
