When I tried to stage change in a hunk, I have

$ git --no-pager apply --cached -
<stdin>:14: trailing whitespace.

<stdin>:19: trailing whitespace.

<stdin>:21: trailing whitespace.

<stdin>:28: trailing whitespace.

<stdin>:33: trailing whitespace.

error: patch failed: somefile.java:286
error: somefile.java: patch does not apply

There is not problem with staging the entire file. Some other hunks
seems to stage fine but with whitespace warnings. I use the msysgit
portable on Windows with cygwin bash as my default shell in emacs. It
seems like there is some kind of problem with quoting the stdin when
passing the patch to git.

EmacsWiki page on Magit mentions a modification for Magit to work oh
Windows which seems related to my problem, but the particular function
mentioned is not in magit.el anymore. I poke around the source a bit
but I cannot not find where I can adapt that change:

  (defun magit-escape-for-shell (str)
    (if (or (string= str "git")
        (string-match "^--" str))
          str
        (concat "'" (replace-regexp-in-string "'" "'\\''" str) "'")))


I would really appreciate some help!

Reply via email to