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

Re: [PATCH/RFC 1/4] contrib: add git-contacts helper

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:58

Junio C Hamano [off-list ref] writes:
 - If the patch were prepared with a non-standard src/dst-prefix,
   unconditional substr($1, 2) would call blame on a wrong (and
   likely to be nonexistent) path without a useful diagnosis (the
   invocation of "git blame" will likely die with "no such path
   'tailofpathname' in $id").

   One way to make it more robust may be to do something like this:

	if (/^--- /) {
		if (m{^--- (?:a/(.*)|/dev/null)$}) {
			$source = ($1 eq '/dev/null') ? undef : $1;
Typo/thinko.  I did that (?:(foo)|bar) thing so that I do not have
to do the conditional.  The above can just be

 		if (m{^--- (?:a/(.*)|/dev/null)$}) {
 			$source = $1;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help