Re: [PATCH] Open external merge tool with original file extensions in all three files

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Pini Reznik <pinir@xxxxxxxxxx> writes:
>
>> This required to be able to use syntax highlighting in meld during
>> conflicts resolution....
>
>> +    extension=`echo $path | awk -F \. '{print $NF}'`
>> +    BACKUP="$path.BACKUP.$$.${extension}"
>> +    LOCAL="$path.LOCAL.$$.${extension}"
>> +    REMOTE="$path.REMOTE.$$.${extension}"
>> +    BASE="$path.BASE.$$.${extension}"
>
> I had to wonder what would happen in these cases:
>
>  * path = "a/b/c/d"
>  * path = "a/b.c/d"
>
> I also think spawning awk for this is way overkill.

IOW, I would probably write the above like this:

	ext="$$$(expr "$path" : '.*\(\.[^/]*\)$')"
        BACKUP="$path.BACKUP.$ext"
        LOCAL="$path.LOCAL.$ext"
        REMOTE="$path.REMOTE.$ext"
        BASE="$path.BASE.$ext"
-
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]

  Powered by Linux