Re: [PATCH] Interpret :/<pattern> as a regular expression

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Interpret :/<pattern> as a regular expression

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:16

Johannes Schindelin [off-list ref] writes:
Earlier, Git interpreted the pattern as a strict prefix, which made
the operator unsuited in many cases.

Now, the pattern is interpreted as a regular expression (which does not 
change the behaviour too much, since few onelines contain special regex 
characters), so that you can say

	git diff :/.*^Signed-off-by:.Zack.Brown

to see the diff against the most recent reachable commit which was
signed off by Zack, whose Kernel Cousin I miss very much.

Signed-off-by: Johannes Schindelin <redacted>
While this perhaps is an improvement and people who are not
interested in paying the price have a choice of not using this
silly syntax, I am moderately annoyed that the syntax does not
define "the most recent reachable" very well.  It is more like
"the first one we happened to pick by diffing from reachable
refs".  It would be more useful if it took "$commit:/$pattern"
form to limit the search among reachable ones from named commit.

Re: [PATCH] Interpret :/<pattern> as a regular expression

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:16

Hi,

On Tue, 12 Jun 2007, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
Earlier, Git interpreted the pattern as a strict prefix, which made
the operator unsuited in many cases.

Now, the pattern is interpreted as a regular expression (which does not 
change the behaviour too much, since few onelines contain special regex 
characters), so that you can say

	git diff :/.*^Signed-off-by:.Zack.Brown

to see the diff against the most recent reachable commit which was
signed off by Zack, whose Kernel Cousin I miss very much.

Signed-off-by: Johannes Schindelin <redacted>
While this perhaps is an improvement and people who are not
interested in paying the price have a choice of not using this
silly syntax, I am moderately annoyed that the syntax does not
define "the most recent reachable" very well.  It is more like
"the first one we happened to pick by diffing from reachable
refs".  It would be more useful if it took "$commit:/$pattern"
form to limit the search among reachable ones from named commit.
"Unfortunately", $commit:/$pattern is not a good syntax, since it suggests 
that you want to search _in_ $commit, not _from $commit.

How about ':/!commit=$commit:$pattern'?

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help