Skip to contentSkip to conversation

Advanced revision selection?

DISCUSSION Nikolaus Rath 2 participants 2 messages Jun 16, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

Is there a way to specify revision ranges that has more power than what's described in gitrevisions(7)?

For example, is there a way to show "the three most recent commits preceding a tag that starts with "release-" that are also descendants of commit aebecf."?

In Mercurial, this can be done with a more verbose syntax (e.g. "last(ancestors(tag("re:release-.*")),3) and descendants(aebeccf)" for the above example). Is there no equivalent in Git, or am I looking for it in the wrong place?

Best,
-Nikolaus

Signature · 4 lines
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«
#1 lore raw
Quoted 3 lines · Nikolaus Rath

In Mercurial, this can be done with a more verbose syntax (e.g. "last(ancestors(tag("re:release-.*")),3) and descendants(aebeccf)" for the above example).

This has no direct equivalent in Git. A lot can be done passing options to "git rev-list" or so, for example, but I don't think a combination can be found for your exact example.

The closest I get is:

  git log `git for-each-ref refs/tags/release- --format '%(refname)'` -3

Which lists 3 commits preceeding a tag whose name starts with release-.

Signature · 2 lines
Matthieu Moy
http://www-verimag.imag.fr/~moy/