0

In specifying the revision youngest commit in branch X not containing word WIP, using the Git <rev>^{/<text>} syntax, I've tried to use the regex answer here.

For instance, I'd expect this command to checkout the commit "My feature foo", when all the younger commits in the branch X contain the word WIP in their message such as "WIP feature bar":

git switch --detach X^{((?!WIP).)*}

However, even with bash escape characters, the pattern apparently doesn't match any commits at all.

[edit]

As pointed out by phd the correct syntax is simply:

git switch --detach 'X^{/!-WIP}'
esskov
  • 367
  • 3
  • 7
  • Please do add your expected result too. It'll help –  Jul 09 '20 at 12:01
  • 1
    What exactly does "it does not work" mean? What happens instead of what you expect? – mkrieger1 Jul 09 '20 at 12:02
  • 2
    Try `'X^{/!-WIP}'`. See [the docs](https://git-scm.com/docs/gitrevisions#Documentation/gitrevisions.txt-emltrevgtlttextgtemegemHEADfixnastybugem). – phd Jul 09 '20 at 12:29

0 Answers0