Re: [PATCH v3 1/2] stash push: avoid printing errors

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

 



Thomas Gummerer <t.gummerer@xxxxxxxxx> writes:

> @@ -322,9 +322,12 @@ push_stash () {
>  
>  		if test $# != 0
>  		then
> -			git add -u -- "$@" |
> -			git checkout-index -z --force --stdin

This obviously is not something this patch breaks, but I am finding
this pipeline that was already here quite puzzling.

The "add -u" is about adding the changes in paths that match the
pathspec to the index; the output from it is meant for human
consumption and certainly is not something "--stdin" should expect
to be understandable, let alone with "-z".

	... goes and digs ...

I think you mis-copied the suggestion in

    https://public-inbox.org/git/xmqqpo7byjwb.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx/

when you made bba067d2 ("stash: don't delete untracked files that
match pathspec", 2018-01-06), and nobody caught that breakage during
the review.

> -			git diff-index -p --cached --binary HEAD -- "$@" | git apply --index -R
> +			if git ls-files --error-unmatch -- "$@" >/dev/null 2>/dev/null
> +			then
> +				git add -u -- "$@" |
> +				git checkout-index -z --force --stdin

And the same breakage is inherited here; just drop "|" and
downstream "checkout-index" and you should be OK.

> +				git diff-index -p --cached --binary HEAD -- "$@" | git apply --index -R

And while at it, let's split this to two lines after "|".

> +			fi




[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