12.08.2017 20:01, Torsten Bögershausen пишет:
On Sat, Aug 12, 2017 at 06:20:23PM +0200, Torsten Bögershausen wrote:
On Sat, Aug 12, 2017 at 07:02:59PM +0300, Soul Trace wrote:
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:
Excellent, thanks so much for the detailed bug report.
This kind of information is really appreciated.
Why did I say excellent ?
Because I am working on a patch, which -should- fix exactly this kind of issues.
I send out a patch earlier this day, but it doesn't fix your issue, even if it should.
I hope to have a fix soonish.
I need to correct mysef, a litte bit, this doesn't seem to be a bug, but a feature.
There are 2 things to be noticed:
- The xml file has been commited with CRLF
- git am strips the CR (because they -may- have been added by a mail program)
There are 2 different solutions:
a) Use git am --keep-cr
b) "Normalize" the xml file(s), and commit them to have LF in the repo,
they can still have CRLF in the work tree, if needed.
This is done by
echo "*.xml text" >>.gitattributes
touch *.xml
git add *.xml .gitattributes
git commit -m "Normalize xml files"
If you really need the xml files with CRLF, use this line instead:
echo "*.xml eol=CRLF" >>.gitattributes
HTH
/Torsten
Thank you.
I will use a) the solution, because I use git am to apply custom patches
to the Android tree from vendorsetup.sh in my device tree at ".
build/envsetup.sh" execution and just want git to apply commits what I
did earlier, when the upstream repositories changes (instead of forking
the upstream repositories, and then merge the upstream changes to the
end of the world).
Thanks for your answer, it's really useful. Good luck in patching your
issue!