git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* feature request: git-log should accept sth like v2.6.26-rc8-227
@ 2008-07-10 18:57 Toralf Förster
  2008-07-10 19:08 ` Junio C Hamano
  2008-07-10 19:29 ` Johannes Schindelin
  0 siblings, 2 replies; 19+ messages in thread
From: Toralf Förster @ 2008-07-10 18:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

Hello,

git-describe gives an informative string about the current status:
tfoerste@n22 ~/devel/linux-2.6 $ git describe
v2.6.26-rc9-56-g6329d30

I appended those strings to the names of my UML kernel executables.
Unfortunately I didn't used the commit id and now I'm wondering whether git
could accept v2.6.26-rc9-56 as well in future.

-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 18:57 feature request: git-log should accept sth like v2.6.26-rc8-227 Toralf Förster
@ 2008-07-10 19:08 ` Junio C Hamano
  2008-07-10 19:42   ` Jakub Narebski
  2008-07-10 19:29 ` Johannes Schindelin
  1 sibling, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2008-07-10 19:08 UTC (permalink / raw)
  To: Toralf Förster; +Cc: git

Toralf Förster <toralf.foerster@gmx.de> writes:

> git-describe gives an informative string about the current status:
> tfoerste@n22 ~/devel/linux-2.6 $ git describe
> v2.6.26-rc9-56-g6329d30
>
> I appended those strings to the names of my UML kernel executables.
> Unfortunately I didn't used the commit id and now I'm wondering whether git
> could accept v2.6.26-rc9-56 as well in future.

It does take v2.6.26-rc9-56-g6329d30.

It will never take v2.6.26-rc9-56.  The world is not linear.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 18:57 feature request: git-log should accept sth like v2.6.26-rc8-227 Toralf Förster
  2008-07-10 19:08 ` Junio C Hamano
@ 2008-07-10 19:29 ` Johannes Schindelin
  2008-07-11 13:39   ` Toralf Förster
  1 sibling, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2008-07-10 19:29 UTC (permalink / raw)
  To: Toralf Förster; +Cc: git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 309 bytes --]

Hi,

On Thu, 10 Jul 2008, Toralf Förster wrote:

> I appended those strings to the names of my UML kernel executables. 
> Unfortunately I didn't used the commit id and now I'm wondering whether 
> git could accept v2.6.26-rc9-56 as well in future.

If that were unambiguous, yes.  But it is not.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 19:08 ` Junio C Hamano
@ 2008-07-10 19:42   ` Jakub Narebski
  2008-07-10 19:52     ` Toralf Förster
                       ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Jakub Narebski @ 2008-07-10 19:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Toralf Förster, git

Junio C Hamano <gitster@pobox.com> writes:

> Toralf Förster <toralf.foerster@gmx.de> writes:
> 
> > git-describe gives an informative string about the current status:
> > tfoerste@n22 ~/devel/linux-2.6 $ git describe
> > v2.6.26-rc9-56-g6329d30
> >
> > I appended those strings to the names of my UML kernel executables.
> > Unfortunately I didn't used the commit id and now I'm wondering whether git
> > could accept v2.6.26-rc9-56 as well in future.
> 
> It does take v2.6.26-rc9-56-g6329d30.
> 
> It will never take v2.6.26-rc9-56.  The world is not linear.

Nevertheless it _could_ be unique.

Besides, it would be nice to have some command (git-rev-parse perhaps?)
which could take ambiguous commit-ish, and list all commit which matches
it.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 19:42   ` Jakub Narebski
@ 2008-07-10 19:52     ` Toralf Förster
  2008-07-10 20:03     ` Junio C Hamano
  2008-07-10 20:36     ` Linus Torvalds
  2 siblings, 0 replies; 19+ messages in thread
From: Toralf Förster @ 2008-07-10 19:52 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Junio C Hamano, git

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

At Thursday 10 July 2008 21:42:53 Jakub Narebski wrote :
> Besides, it would be nice to have some command (git-rev-parse perhaps?)
> which could take ambiguous commit-ish, and list all commit which matches
> it.

Oh yes :-)

-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 19:42   ` Jakub Narebski
  2008-07-10 19:52     ` Toralf Förster
@ 2008-07-10 20:03     ` Junio C Hamano
  2008-07-10 22:24       ` Johannes Schindelin
  2008-07-10 20:36     ` Linus Torvalds
  2 siblings, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2008-07-10 20:03 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Toralf Förster, git

Jakub Narebski <jnareb@gmail.com> writes:

> Besides, it would be nice to have some command (git-rev-parse perhaps?)
> which could take ambiguous commit-ish, and list all commit which matches
> it.

Have fun writing it and send in a patch.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 19:42   ` Jakub Narebski
  2008-07-10 19:52     ` Toralf Förster
  2008-07-10 20:03     ` Junio C Hamano
@ 2008-07-10 20:36     ` Linus Torvalds
  2 siblings, 0 replies; 19+ messages in thread
From: Linus Torvalds @ 2008-07-10 20:36 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Junio C Hamano, Toralf Förster, git



On Thu, 10 Jul 2008, Jakub Narebski wrote:
> 
> Nevertheless it _could_ be unique.

NO IT COULD NOT!

It doesn't matter if it's unique in _one_ repository. What matters is if 
it is globally unique!

Otherwise, people will start sending these version numbers out in emails, 
and now somethign that was unique in the senders repo is actually not 
unique at the receivers side (or _is_ unique, but points to something 
totally different).

So no. A revision number like "v2.6.26-rc8-227" is fundamentally and 
utterly broken. No way it should ever be accepted, even as a "helpful" 
thing, because it's not helpful at all. It would be a sure way to crap.

		Linus

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 20:03     ` Junio C Hamano
@ 2008-07-10 22:24       ` Johannes Schindelin
  2008-07-10 22:52         ` Junio C Hamano
  0 siblings, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2008-07-10 22:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jakub Narebski, Toralf Förster, git

Hi,

On Thu, 10 Jul 2008, Junio C Hamano wrote:

> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > Besides, it would be nice to have some command (git-rev-parse 
> > perhaps?) which could take ambiguous commit-ish, and list all commit 
> > which matches it.
> 
> Have fun writing it and send in a patch.

Note that this really could be a patch, but not for rev-parse.  Patch 
revision.c instead to parse the argument into _all_ matching revisions.

The :/ notation I no longer like so much should give you a lot of 
inspiration.

Good luck,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 22:24       ` Johannes Schindelin
@ 2008-07-10 22:52         ` Junio C Hamano
  2008-07-10 23:08           ` Jakub Narebski
  2008-07-10 23:47           ` Johannes Schindelin
  0 siblings, 2 replies; 19+ messages in thread
From: Junio C Hamano @ 2008-07-10 22:52 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, Toralf Förster, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Thu, 10 Jul 2008, Junio C Hamano wrote:
>
>> Jakub Narebski <jnareb@gmail.com> writes:
>> 
>> > Besides, it would be nice to have some command (git-rev-parse 
>> > perhaps?) which could take ambiguous commit-ish, and list all commit 
>> > which matches it.
>> 
>> Have fun writing it and send in a patch.
>
> Note that this really could be a patch, but not for rev-parse.  Patch 
> revision.c instead to parse the argument into _all_ matching revisions.

As Linus pointed out, that is "all _locally_ matching revisions".  It is
of dubious value in a distributed environment.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 22:52         ` Junio C Hamano
@ 2008-07-10 23:08           ` Jakub Narebski
  2008-07-10 23:47           ` Johannes Schindelin
  1 sibling, 0 replies; 19+ messages in thread
From: Jakub Narebski @ 2008-07-10 23:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Toralf Förster, git

Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> On Thu, 10 Jul 2008, Junio C Hamano wrote:
>>> Jakub Narebski <jnareb@gmail.com> writes:
>>> 
>>>> Besides, it would be nice to have some command (git-rev-parse 
>>>> perhaps?) which could take ambiguous commit-ish, and list all commit 
>>>> which matches it.
>>> 
>>> Have fun writing it and send in a patch.
>>
>> Note that this really could be a patch, but not for rev-parse.  Patch 
>> revision.c instead to parse the argument into _all_ matching revisions.
> 
> As Linus pointed out, that is "all _locally_ matching revisions".  It is
> of dubious value in a distributed environment.

It can be useful for example in situation where shortened sha-1 of
a commit (for example to 6 characters) stops being ambiguous...

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 22:52         ` Junio C Hamano
  2008-07-10 23:08           ` Jakub Narebski
@ 2008-07-10 23:47           ` Johannes Schindelin
  1 sibling, 0 replies; 19+ messages in thread
From: Johannes Schindelin @ 2008-07-10 23:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jakub Narebski, Toralf Förster, git

Hi,

On Thu, 10 Jul 2008, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Thu, 10 Jul 2008, Junio C Hamano wrote:
> >
> >> Jakub Narebski <jnareb@gmail.com> writes:
> >> 
> >> > Besides, it would be nice to have some command (git-rev-parse 
> >> > perhaps?) which could take ambiguous commit-ish, and list all commit 
> >> > which matches it.
> >> 
> >> Have fun writing it and send in a patch.
> >
> > Note that this really could be a patch, but not for rev-parse.  Patch 
> > revision.c instead to parse the argument into _all_ matching revisions.
> 
> As Linus pointed out, that is "all _locally_ matching revisions".  It is 
> of dubious value in a distributed environment.

Right.  Judging from some of the conversations on IRC (and even on this 
list), it seems that the word "local" for the reflogs is lost on some, and 
there is no reason to expect otherwise for the currently proposed thing.

So strike my suggestions,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-10 19:29 ` Johannes Schindelin
@ 2008-07-11 13:39   ` Toralf Förster
  2008-07-11 14:36     ` Johannes Schindelin
  2008-07-11 14:44     ` Dmitry Potapov
  0 siblings, 2 replies; 19+ messages in thread
From: Toralf Förster @ 2008-07-11 13:39 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 842 bytes --]

At Thursday 10 July 2008 21:29:07 Johannes Schindelin wrote :
> Hi,
> 
> On Thu, 10 Jul 2008, Toralf Förster wrote:
> 
> > I appended those strings to the names of my UML kernel executables. 
> > Unfortunately I didn't used the commit id and now I'm wondering whether 
> > git could accept v2.6.26-rc9-56 as well in future.
> 
> If that were unambiguous, yes.  But it is not.
> 
> Ciao,
> Dscho
> 

Ok, following the thread I understand why this feature isn't wanted by all. But
for the given example (where I only pulled from another git tree) this could
work, isn't it : ?

tfoerste@n22 ~/devel/linux-2.6 $ git-log v2.6.26-rc9.. | perl -e '@c = grep { /^commit/ } <>; print map { $#c - $i++ . "\t" . $_ } @c'


-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-11 13:39   ` Toralf Förster
@ 2008-07-11 14:36     ` Johannes Schindelin
  2008-07-11 14:44       ` Toralf Förster
  2008-07-11 14:44     ` Dmitry Potapov
  1 sibling, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2008-07-11 14:36 UTC (permalink / raw)
  To: Toralf Förster; +Cc: git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1356 bytes --]

Hi,

On Fri, 11 Jul 2008, Toralf Förster wrote:

> At Thursday 10 July 2008 21:29:07 Johannes Schindelin wrote :
> 
> > On Thu, 10 Jul 2008, Toralf Förster wrote:
> > 
> > > I appended those strings to the names of my UML kernel executables. 
> > > Unfortunately I didn't used the commit id and now I'm wondering 
> > > whether git could accept v2.6.26-rc9-56 as well in future.
> > 
> > If that were unambiguous, yes.  But it is not.
> 
> Ok, following the thread I understand why this feature isn't wanted by 
> all. But for the given example (where I only pulled from another git 
> tree) this could work, isn't it : ?
> 
> tfoerste@n22 ~/devel/linux-2.6 $ git-log v2.6.26-rc9.. | perl -e '@c = grep { /^commit/ } <>; print map { $#c - $i++ . "\t" . $_ } @c'

The question is not so much if it would work, but what people would do 
with this.  They would probably include something in a mail to you like 
"v2.6.26-rc9-111 stopped working!", you would test "v2.6.26-rc9-111" and 
go back "but it still works!".

Because you are talking about two different things.

So, in what workflow would v2.6.26-rc9-111 actually be helpful?  For 
yourself working in your own lil' branch?  I do not think so.  HEAD~23 is 
much more helpful in that case, since locally, you do not work so much 
relative to a given tag, but relative to your current HEAD.

Hth,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-11 13:39   ` Toralf Förster
  2008-07-11 14:36     ` Johannes Schindelin
@ 2008-07-11 14:44     ` Dmitry Potapov
  2008-07-11 14:58       ` Toralf Förster
  1 sibling, 1 reply; 19+ messages in thread
From: Dmitry Potapov @ 2008-07-11 14:44 UTC (permalink / raw)
  To: Toralf Förster; +Cc: Johannes Schindelin, git

On Fri, Jul 11, 2008 at 5:39 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>
> Ok, following the thread I understand why this feature isn't wanted by all. But
> for the given example (where I only pulled from another git tree) this could
> work, isn't it : ?
>
> tfoerste@n22 ~/devel/linux-2.6 $ git-log v2.6.26-rc9.. | perl -e '@c = grep { /^commit/ } <>; print map { $#c - $i++ . "\t" . $_ } @c'

No, it does not. Running your script, I have

...
56      commit 803a9067e19714ea7b7da760fe92f0d53bfa6994
...

Now, let's see what git-describe thinks about it
$ git describe 803a9067e19714ea7b7da760fe92f0d53bfa6994
v2.6.26-rc9-38-g803a906

Your script is obviously incorrect. It is written in the assumption that
history is linear, but it is not. Even if you pull only from one repo,
this repo still contains *many* branches. Along any branch, you may have
the same number.

Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-11 14:36     ` Johannes Schindelin
@ 2008-07-11 14:44       ` Toralf Förster
  0 siblings, 0 replies; 19+ messages in thread
From: Toralf Förster @ 2008-07-11 14:44 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

At Friday 11 July 2008 16:36:07 Johannes Schindelin wrote :

> The question is not so much if it would work, but what people would do 
> with this.  They would probably include something in a mail to you like 
> "v2.6.26-rc9-111 stopped working!", you would test "v2.6.26-rc9-111" and 
> go back "but it still works!".
> 
> Because you are talking about two different things.
> 
> So, in what workflow would v2.6.26-rc9-111 actually be helpful?  For 
> yourself working in your own lil' branch?  I do not think so.  HEAD~23 is 
> much more helpful in that case, since locally, you do not work so much 
> relative to a given tag, but relative to your current HEAD.
> 
> Hth,
> Dscho

Ah yes, this clarified it for me.




-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-11 14:44     ` Dmitry Potapov
@ 2008-07-11 14:58       ` Toralf Förster
  2008-07-11 19:29         ` Dmitry Potapov
  0 siblings, 1 reply; 19+ messages in thread
From: Toralf Förster @ 2008-07-11 14:58 UTC (permalink / raw)
  To: Dmitry Potapov; +Cc: Johannes Schindelin, git

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

At Friday 11 July 2008 16:44:23 Dmitry Potapov wrote :
> On Fri, Jul 11, 2008 at 5:39 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
> >
> > Ok, following the thread I understand why this feature isn't wanted by all. But
> > for the given example (where I only pulled from another git tree) this could
> > work, isn't it : ?
> >
> > tfoerste@n22 ~/devel/linux-2.6 $ git-log v2.6.26-rc9.. | perl -e '@c = grep { /^commit/ } <>; print map { $#c - $i++ . "\t" . $_ } @c'
> 
> No, it does not. Running your script, I have
> 
> ...
> 56      commit 803a9067e19714ea7b7da760fe92f0d53bfa6994
> ...
> 
> Now, let's see what git-describe thinks about it
> $ git describe 803a9067e19714ea7b7da760fe92f0d53bfa6994
> v2.6.26-rc9-38-g803a906
> 
> Your script is obviously incorrect. It is written in the assumption that
> history is linear, but it is not. Even if you pull only from one repo,
> this repo still contains *many* branches. Along any branch, you may have
> the same number.
> 
> Dmitry
> 

Yes,

$> git-log v2.6.26-rc9.. --pretty=short | grep "^commit" | cut -f2 -d' ' | xargs -n 1 git describe | grep '\-56\-'

I used eventually to get the commit id for the (broken) UML kernel 2.6.26-rc9-56

-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-11 14:58       ` Toralf Förster
@ 2008-07-11 19:29         ` Dmitry Potapov
  2008-07-11 19:57           ` Johannes Schindelin
  0 siblings, 1 reply; 19+ messages in thread
From: Dmitry Potapov @ 2008-07-11 19:29 UTC (permalink / raw)
  To: Toralf Förster; +Cc: Johannes Schindelin, git

On Fri, Jul 11, 2008 at 04:58:40PM +0200, Toralf Förster wrote:
> 
> $> git-log v2.6.26-rc9.. --pretty=short | grep "^commit" | cut -f2 -d' ' | xargs -n 1 git describe | grep '\-56\-'

The fastest way to do the same would be:

git rev-list v2.6.26-rc9.. | xargs git describe | grep '\-56\-'


Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-11 19:29         ` Dmitry Potapov
@ 2008-07-11 19:57           ` Johannes Schindelin
  2008-07-11 20:35             ` Johannes Schindelin
  0 siblings, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2008-07-11 19:57 UTC (permalink / raw)
  To: Dmitry Potapov; +Cc: Toralf Förster, git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 706 bytes --]

Hi,

On Fri, 11 Jul 2008, Dmitry Potapov wrote:

> On Fri, Jul 11, 2008 at 04:58:40PM +0200, Toralf Förster wrote:
> > 
> > $> git-log v2.6.26-rc9.. --pretty=short | grep "^commit" | cut -f2 -d' ' | xargs -n 1 git describe | grep '\-56\-'
> 
> The fastest way to do the same would be:
> 
> git rev-list v2.6.26-rc9.. | xargs git describe | grep '\-56\-'

You forgot the "--all" option to rev-list.

And I doubt it would be the "fastest" way, in terms of execution speed.

Also, it leaves out this case:

rc9 - A - B - C - D - F
    \               /
      ----- E -----

F would be "rc9-5", but also "rc9-2".

Oh, and this would leave out reflogs, too.

Can we please let this concept die now?

Hth,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
  2008-07-11 19:57           ` Johannes Schindelin
@ 2008-07-11 20:35             ` Johannes Schindelin
  0 siblings, 0 replies; 19+ messages in thread
From: Johannes Schindelin @ 2008-07-11 20:35 UTC (permalink / raw)
  To: Dmitry Potapov; +Cc: Toralf Förster, git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1833 bytes --]

Hi,

On Fri, 11 Jul 2008, Johannes Schindelin wrote:

> On Fri, 11 Jul 2008, Dmitry Potapov wrote:
> 
> > On Fri, Jul 11, 2008 at 04:58:40PM +0200, Toralf Förster wrote:
> > > 
> > > $> git-log v2.6.26-rc9.. --pretty=short | grep "^commit" | cut -f2 -d' ' | xargs -n 1 git describe | grep '\-56\-'
> > 
> > The fastest way to do the same would be:
> > 
> > git rev-list v2.6.26-rc9.. | xargs git describe | grep '\-56\-'
> 
> You forgot the "--all" option to rev-list.
> 
> And I doubt it would be the "fastest" way, in terms of execution speed.
> 
> Also, it leaves out this case:
> 
> rc9 - A - B - C - D - F
>     \               /
>       ----- E -----
> 
> F would be "rc9-5", but also "rc9-2".
> 
> Oh, and this would leave out reflogs, too.
> 
> Can we please let this concept die now?

Heh, just as an intellectual exercise, I could not resist trying to brush 
up my l33t py7h0n sk1llz (and I am sure somebody will teach me something 
useful again):

-- snipsnap --
#!/usr/bin/python

import os
import sys

if len(sys.argv) != 2:
	print 'Usage:', sys.argv[0], '<pseudo-describe>'

# split argument
dash = sys.argv[1].rindex('-')
tag = sys.argv[1][0:dash]
generation = int(sys.argv[1][dash + 1:])

# get sha1 of given tag's commit
pipe = os.popen('git rev-parse ' + tag + '^{commit}')
sha1 = pipe.readlines()[0].strip()
pipe.close()

# 'number' will contain (positive) distance to given commit
number = dict()
number[sha1] = set()
number[sha1].add(0)

pipe = os.popen('git rev-list ^' + sha1 + ' --all --parents')
rev_list = pipe.readlines()
pipe.close()

rev_list.reverse()
for line in rev_list:
	list = line.strip().split(' ')
	number[list[0]] = set()
	for parent in list[1:]:
		if parent in number:
			for n in number[parent]:
				number[list[0]].add(n + 1)
	for n in number[list[0]]:
		if n == generation:
			print list[0]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2008-07-11 20:36 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10 18:57 feature request: git-log should accept sth like v2.6.26-rc8-227 Toralf Förster
2008-07-10 19:08 ` Junio C Hamano
2008-07-10 19:42   ` Jakub Narebski
2008-07-10 19:52     ` Toralf Förster
2008-07-10 20:03     ` Junio C Hamano
2008-07-10 22:24       ` Johannes Schindelin
2008-07-10 22:52         ` Junio C Hamano
2008-07-10 23:08           ` Jakub Narebski
2008-07-10 23:47           ` Johannes Schindelin
2008-07-10 20:36     ` Linus Torvalds
2008-07-10 19:29 ` Johannes Schindelin
2008-07-11 13:39   ` Toralf Förster
2008-07-11 14:36     ` Johannes Schindelin
2008-07-11 14:44       ` Toralf Förster
2008-07-11 14:44     ` Dmitry Potapov
2008-07-11 14:58       ` Toralf Förster
2008-07-11 19:29         ` Dmitry Potapov
2008-07-11 19:57           ` Johannes Schindelin
2008-07-11 20:35             ` Johannes Schindelin

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).