Re: [PATCH] rev-parse --show-prefix: add in trailing newline

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

 



Junio C Hamano wrote:

> But it will break existing scripts if they expect the following to work:
>
> 	file="$(git rev-parse --show-prefix)/$1"
>         cd_to_toplevel
>         test -f "$file"

Huh?  I tried this:

	$ foo="$(printf '\n')/bar"
	$ printf '%s\n' "$foo"
	/bar

If that didn't work, it would mean that "git rev-parse --show-prefix"
would never work when the prefix is nonempty, because it is followed
by a newline.
--
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]