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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> 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;

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]