git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git am sometimes unable to apply git format-patch output file
@ 2017-08-12 16:02 Soul Trace
  2017-08-12 16:20 ` Torsten Bögershausen
  0 siblings, 1 reply; 4+ messages in thread
From: Soul Trace @ 2017-08-12 16:02 UTC (permalink / raw)
  To: git

Hello.

Using git i have found that git am command may sometimes fail to apply 
patch file which was created by the git am command.


Steps to reproduce:

# 1. Clone test repository:

git clone https://github.com/S-trace/git_am_bug_test.git

# 2. Format patch file for last commit:

git format-patch HEAD~

# 3. Go to previous commit:

git checkout HEAD~

# 4. Apply back patch file created in step 2:

git am 0001-UPDATE-Update-ascend_MOGOLIA_ULG_normal.xml.patch

The git am command fails on my machine with the following error message:

Applying: Update ascend_MOGOLIA_ULG_normal.xml
.git/rebase-apply/patch:6522: trailing whitespace.
     </scene>
error: patch failed: ascend_MOGOLIA_ULG_normal.xml:1
error: ascend_MOGOLIA_ULG_normal.xml: patch does not apply
Patch failed at 0001 Update ascend_MOGOLIA_ULG_normal.xml
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


But patch command can handle this patch file:

patch -p1 -i 0001-UPDATE-Update-ascend_MOGOLIA_ULG_normal.xml.patch


Versions information:

git --version
git version 2.11.0

patch --version
GNU patch 2.7.5
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall

License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Larry Wall and Paul Eggert

uname -a
Linux omen 4.10.0-26-generic #30-Ubuntu SMP Tue Jun 27 09:30:12 UTC 2017 
x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty


Thank you.


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

end of thread, other threads:[~2017-08-16  7:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-12 16:02 [BUG] git am sometimes unable to apply git format-patch output file Soul Trace
2017-08-12 16:20 ` Torsten Bögershausen
2017-08-12 17:01   ` Torsten Bögershausen
2017-08-16  7:45     ` Soul Trace

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).