1

I'm pulling my hair already and would be glad about some help.

I'm exporting a git repository with files only by means of

git format-patch --root -o /tmp/foo

and trying to add the files with history to another repository, by means of

git am --directory=foo --reject /tmp/foo/*.patch

The directory a does not exist in the repository, hence there can't be any conflicts. The patches are the ONLY changes applied.

Still my patches fail.

The services.sass.rej file (from first failing patch 0067) contains this:

diff a/foo/services.sass b/foo/services.sass    (rejected hunks)
@@ -2,7 +2,7 @@
 @import compass/css3/background-size

header
-  background: white  url('/img/bg/angebot.jpg') no-repeat top center
+  background: white  url('../img/bg/angebot.jpg') no-repeat top center
   +background-size(100% auto)

   +fullView

When I check services.sass, it starts with the following:

@import globals
@import compass/css3/background-size
@import compass/css3/animation

header
  background: white  url('/img/bg/angebot.jpg') no-repeat top center
  +background-size(100% auto)

  +fullView

Therefore the patch was created completely wrong, missing a complete line (@import compass/css3/animation). How is that possible and how can I avoid that?

Andy
  • 4,783
  • 2
  • 26
  • 51
  • I just looked into the `git diff` for the commit producing the patch 0067, as well as into that version of the services.sass as into the following one. The animation-line is missing in all of them. So why is it still in the file when applying the patches? – Andy Oct 28 '15 at 17:07
  • For any normal (non-merge) commit, the patch from `git format-patch` is the same as the one you'd see with `git show` of the same commit ID, and is formed by diff-ing that commit against its parent. Without more information that's all I can say here. – torek Oct 28 '15 at 18:09

0 Answers0