public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* Advanced revision selection?
@ 2016-05-27 15:39 Nikolaus Rath
  2016-05-27 15:59 ` Matthieu Moy
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolaus Rath @ 2016-05-27 15:39 UTC (permalink / raw)
  To: git

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

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

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

* Re: Advanced revision selection?
  2016-05-27 15:39 Advanced revision selection? Nikolaus Rath
@ 2016-05-27 15:59 ` Matthieu Moy
  0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Moy @ 2016-05-27 15:59 UTC (permalink / raw)
  To: git

Nikolaus Rath <Nikolaus@rath•org> writes:

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

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

end of thread, other threads:[~2016-05-27 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-27 15:39 Advanced revision selection? Nikolaus Rath
2016-05-27 15:59 ` Matthieu Moy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox