{"thread":{"id":"42469","subject":"Advanced revision selection?","startedAt":"2016-05-27T15:39:32Z","lastAt":"2016-05-27T15:59:12Z","messageCount":2,"participants":["Nikolaus Rath","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"287684","messageId":"874m9j7bnv.fsf@thinkpad.rath.org","threadId":"42469","inReplyTo":null,"subject":"Advanced revision selection?","fromName":"Nikolaus Rath","fromEmail":"nikolaus@rath.org","sentAt":"2016-05-27T15:39:32Z","receivedAt":"2016-05-27T15:39:32Z","isPatch":false,"sender":{"key":"nikolaus@rath.org","avatar":"https://gravatar.com/avatar/d3b6cdc023a0665882d5aac373c0115bcb36f730c2e4a4051061fefbaf7dd041?d=mp&s=160"},"body":"Hello,\n\nIs there a way to specify revision ranges that has more power than\nwhat's described in gitrevisions(7)?\n\nFor example, is there a way to show \"the three most recent commits\npreceding a tag that starts with \"release-\" that are also descendants of\ncommit aebecf.\"?\n\nIn Mercurial, this can be done with a more verbose syntax (e.g.\n\"last(ancestors(tag(\"re:release-.*\")),3) and descendants(aebeccf)\" for\nthe above example). Is there no equivalent in Git, or am I looking for\nit in the wrong place?\n\nBest,\n-Nikolaus\n\n-- \nGPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F\nFingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F\n\n             »Time flies like an arrow, fruit flies like a Banana.«\n"},{"id":"287686","messageId":"vpq8tyvmqzz.fsf@anie.imag.fr","threadId":"42469","inReplyTo":"874m9j7bnv.fsf@thinkpad.rath.org","subject":"Re: Advanced revision selection?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-05-27T15:59:12Z","receivedAt":"2016-05-27T15:59:12Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Nikolaus Rath <Nikolaus@rath.org> writes:\n\n> In Mercurial, this can be done with a more verbose syntax (e.g.\n> \"last(ancestors(tag(\"re:release-.*\")),3) and descendants(aebeccf)\" for\n> the above example).\n\nThis has no direct equivalent in Git. A lot can be done passing options\nto \"git rev-list\" or so, for example, but I don't think a combination\ncan be found for your exact example.\n\nThe closest I get is:\n\n  git log `git for-each-ref refs/tags/release- --format '%(refname)'` -3\n\nWhich lists 3 commits preceeding a tag whose name starts with release-.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}