Re: [PATCH] Add --patchdepth parameter to git-am.sh

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

 



Andy Parkins <andyparkins@xxxxxxxxx> writes:

> If the series of patches you are applying via git-am was based in a
> different directory there was no way to strip the directory (as you
> would with git-apply).
>
> This patch adds a --patchdepth option to git-am.sh whose argument is
> passed as a "-p" option to git-apply.
>
> Signed-off-by: Andy Parkins <andyparkins@xxxxxxxxx>
> ---
> I know git-apply isn't going anywhere, but git-applypatch is.  However, all
> this talk of it made me remember this patch.

I do not understand this remark, as applypatch does not have -p
either.  If we were to do this, I agree with others that this
should simply be called -p (we do not have name crash with
existing options, do we?).

I am not sure how useful applying a patch though git-am with -p
would be.  I can understand, 

After seeing that a patch does not apply because the patch was
generated at the wrong level, it would be very natural to use
"git apply -p0 --index .dotest/patch" and then continue with
"git am --resolved".  So obviously, -p to git-apply is very
useful, but -p given to "am" means all of the patches in your
mailbox has uniformly wrong patch depth.  I wonder how common
would that be in practice.

But other than that "how useful would that be in practice?"
issue, I do not think the patch is too bad, except one hunk:

> @@ -389,12 +392,12 @@ do
>  	fi
>  
>  	echo
> -	echo "Applying '$SUBJECT'"
> +	echo "Applying '$SUBJECT' at depth $patchdepth"
>  	echo
>  

This is wrong if you do not use any $patchdepth.

-
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]