Re: [RFC PATCH] Make :/ accept a regex rather than a fixed pattern
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:59
Linus Torvalds [off-list ref] writes:
From: Linus Torvalds <torvalds@linux-foundation.org> Date: Fri, 23 Apr 2010 08:20:20 -0700 Subject: [PATCH] Make :/ accept a regex rather than a fixed pattern This also makes it trigger anywhere in the commit message, rather than just at the beginning. Which tends to be a lot more useful. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> --- I'm re-sending, because after having this in my tree for several weeks now, I actually end up still using it. I agree that it's still not a wonderful thing, and it's entirely possible that we should strive to use just HEAD in :/ commit finding rather than all refs we can find, but for at least the kernel, I don't care (since my tree tends to have just one main branch anyway, apart from some random testing stuff I keep around). But even if we want to limit it to HEAD, that would be a separate patch. I've personally used it for things like git show :/mqueue # did I apply that 'mqueue' patch? git show :/akpm # what was the last patch I got from Andrew? and while in all cases I could admittedly have done exactly the same thing with something like "git log -p -1 --grep=mqueue" instead, I've used it as a nice shortcut.
I already took this but I actually started hating it. As I have
merge.summary on,
git show ':/diff: add configuration option'
almost never hits the commit I am looking for---instead it ends up finding
a merge that merges it.
I however suspect that I would hate it much less after retraining my
fingers to anchor the pattern at the beginning of the line. But not
yet...