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}'