All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ernesto Alfonso <erjoalgo@gmail.com>
To: git@vger.kernel.org
Subject: git apply fails silently when on the wrong directory
Date: Tue, 26 Sep 2017 17:53:55 -0700	[thread overview]
Message-ID: <87k20lt10c.fsf@gmail.com> (raw)

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

             reply	other threads:[~2017-09-27  0:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27  0:53 Ernesto Alfonso [this message]
2017-09-27  0:55 ` git apply fails silently when on the wrong directory Ernesto Alfonso
2017-09-27  1:25 ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k20lt10c.fsf@gmail.com \
    --to=erjoalgo@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.