Thread (1 message) 1 message, 1 author, 2016-06-15

Which branch(es) contain certain commits? (was Re: (unknown))

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:05

Ivan Chernyavsky [off-list ref] writes:
For some time I'm wondering why there's no "--grep" option to the "git
branch" command, which would request to print only branches having
specified string/regexp in their history.

So for example:

    $ git branch -r --grep=BUG12345

should be roughly equivalent to following expression I'm using now for the same task:

    $ for r in `git rev-list --grep=BUG12345 --remotes=origin`; do git
branch -r --list --contains=$r 'origin/*'; done | sort -u

Am I missing something, is there some smarter/simpler way to do this?
I think people do things like:

    git log --all --decorate --grep=...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help