Re: git apply fails silently when on the wrong directory

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

 



Also, has there been a feature request for a '-w' option to 'git add',
analogous to the same option in 'git diff'?

Ernesto Alfonso <erjoalgo@xxxxxxxxx> writes:

> I recently ran into a similar issue as described here:
>
> https://stackoverflow.com/questions/24821431/git-apply-patch-fails-silently-no-errors-but-nothing-happens
>
> I was using the alias:
>
> alias ganw='git diff -U0 -w --no-color "$@" | git apply --cached --ignore-whitespace --unidiff-zero -'
>
> to stage non-whitespace changes, but I was not in the root directory and
> the changes were not being applied. I broke down the command to discover
> the 'git apply' part of the pipe was silently failing to apply anything,
> exiting 0 without even a warning.
>
> The exit status and lack of warning is terribly misleading, I imagine
> this would be the cause of subtle bugs in automated scripts. 
>
> Is this expected behaviour?
>
> Thanks,
>
> Ernesto



[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