Re: [PATCH 12/13] contrib/subtree: Handle '--prefix' argument with a slash appended

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

 



"David A. Greene" <greened@xxxxxxxxxxxxx> writes:

> From: Techlive Zheng <techlivezheng@xxxxxxxxx>
>
> 'git subtree merge' will fail if the argument of '--prefix' has a slash
> appended.
>
> Signed-off-by: Techlive Zheng <techlivezheng@xxxxxxxxx>
> Signed-off-by: David A. Greene <greened@xxxxxxxxxxxxx>
> ---
>  contrib/subtree/git-subtree.sh     |    2 +-
>  contrib/subtree/t/t7900-subtree.sh |   19 +++++++++++++++++++
>  2 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index c72af95..0493e47 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -82,7 +82,7 @@ while [ $# -gt 0 ]; do
>  		--annotate) annotate="$1"; shift ;;
>  		--no-annotate) annotate= ;;
>  		-b) branch="$1"; shift ;;
> -		-P) prefix="$1"; shift ;;
> +		-P) prefix="${1%/}"; shift ;;

While it may not be a bad change per-se, I have to wonder if it is
worth special casing "--prefix=foo/", that should have been spelled
as "--prefix=foo", while still failing misspelling like "--prefix=foo//"
and possibly other forms, perhaps "--prefix=foo//bar/baz"?
--
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]