git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git rm / format-patch / am fails on my file: patch does not apply
@ 2013-11-11  2:39 Ken Tanzer
  2013-11-11 19:04 ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Tanzer @ 2013-11-11  2:39 UTC (permalink / raw)
  To: git; +Cc: Philip Oakley

I originally posted about this to the git-users list
(https://groups.google.com/forum/#!topic/git-users/G5D0bldEbTo).  If
this would normally be expected to work:

git add <file>
git commit
git rm <file>
git commit
git format-patch HEAD~1
git reset --hard HEAD~1
git am 0001*patch

then I'm having a problem with at least one (maybe more) file I have
in a repository that seems like a bug.  Even if I copy it to a new
repository, it will still fail, so it seems something about how git
handles the file, which "file" reports as:

ASCII text, with very long lines, with CRLF, CR, LF line terminators

I've confirmed with the following test case on three machines, so it
seems reproducible:

mkdir temp_test_case
cd temp_test_case
git init
# my file.  Sorry--couldn't find a saner link!
wget -O jquery-ui-1.8.custom.min.js
http://sourceforge.net/p/agency/code/ci/9358ea4dbe8e1540ec0b8bebfc7770f1bf8be0ec/tree/jquery-ui-1.8.custom.min.js?format=raw
git add jquery-ui-1.8.custom.min.js
git commit -m 'Adding jquery-ui'
git rm jquery-ui-1.8.custom.min.js
git commit -m 'Removing jquery-ui'
git format-patch HEAD~1
git reset --hard HEAD~1
git am 0001*

The last command reports the following:

Applying: Removing jquery-ui
error: patch failed: jquery-ui-1.8.custom.min.js:1
error: jquery-ui-1.8.custom.min.js: patch does not apply
Patch failed at 0001 Removing jquery-ui
The copy of the patch that failed is found in:
   /home/user/newtest2/temp_test_case/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Let me know if I can provide more information, or am missing something
obvious!  Thanks.

Ken

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-11-14  7:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11  2:39 git rm / format-patch / am fails on my file: patch does not apply Ken Tanzer
2013-11-11 19:04 ` Junio C Hamano
2013-11-11 19:15   ` Stefan Beller
2013-11-11 19:37     ` Junio C Hamano
2013-11-11 19:43       ` Stefan Beller
2013-11-11 20:39         ` Stefan Beller
2013-11-13  0:26   ` Ken Tanzer
2013-11-13 17:04     ` Junio C Hamano
2013-11-13 23:12       ` Philip Oakley
2013-11-14  7:26         ` Ken Tanzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).