Re: Bootstrapping into git, commit gripes at me

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: Bootstrapping into git, commit gripes at me

From: Marc Singer <hidden>
Date: 2016-06-15 22:42:01

 $ git checkout -f v2.6.11 ;# fixed one
 warning: v2.6.11 is not a commit -- not updating your HEAD
 $ git commit ;# to have his own baseline at v2.6.11
 $ git-apply --index --stat --summary --apply <../old-patch-file
 $ : do the usual tests
 $ git commit ;# create a commit based on the baseline v2.6.11
Interesting note.  I tried the git-apply command and found that it
complained and wouldn't succeed.

  elf@florence ~...embedded/linux-2.6 > git-apply --index --stat --summary --apply < ../ms16/ide.patch 
  error: patch failed: drivers/ide/ide-io.c:129
  error: drivers/ide/ide-io.c: patch does not apply

Yet, patch does apply.

  elf@florence ~...embedded/linux-2.6 > patch -p1 < ../ms16/ide.patch
  patching file drivers/ide/arm/ide_arm.c
  patching file drivers/ide/arm/ide-lpd7952x.c
  patching file drivers/ide/arm/ide-lpd7a40x.c
  patching file drivers/ide/arm/Makefile
  patching file drivers/ide/ide-disk.c
  Hunk #1 succeeded at 282 (offset 41 lines).
  Hunk #2 succeeded at 294 (offset 41 lines).
  patching file drivers/ide/ide-io.c
  Hunk #1 succeeded at 96 with fuzz 2 (offset -33 lines).
  Hunk #2 succeeded at 1227 (offset 189 lines).
  Hunk #3 succeeded at 1388 (offset 189 lines).
  Hunk #4 succeeded at 1689 (offset 187 lines).
  patching file drivers/ide/ide-iops.c
  patching file drivers/ide/ide-probe.c
  Hunk #1 succeeded at 422 (offset 51 lines).
  Hunk #2 succeeded at 784 (offset 59 lines).
  Hunk #3 succeeded at 847 (offset 59 lines).
  Hunk #4 succeeded at 1112 (offset 64 lines).
  Hunk #5 succeeded at 1172 (offset 64 lines).
  patching file drivers/ide/Kconfig
  Hunk #1 succeeded at 272 (offset -1 lines).
  Hunk #2 succeeded at 781 (offset 5 lines).
  patching file drivers/ide/legacy/ht6560b.c
  patching file drivers/ide/legacy/qd65xx.c
  patching file drivers/ide/pci/ns87415.c
  patching file drivers/ide/pci/sl82c105.c
  patching file drivers/ide/pci/trm290.c
  patching file drivers/ide/ppc/pmac.c
  Hunk #1 succeeded at 572 (offset 61 lines).
  Hunk #2 succeeded at 596 (offset 61 lines).
  patching file include/linux/ide.h
  Hunk #1 succeeded at 961 (offset 1 line).
  Hunk #2 succeeded at 1497 (offset -14 lines).

It should be obvious that a patch that doesn't apply cleanly,
i.e. without rejects, is still useful to apply so that I can fix the
places where it fails.

  o Why does patch work and git-apply fail?
  o Is there a way to force git to apply and safe the rejects?

Re: Bootstrapping into git, commit gripes at me

From: Matthias Urlichs <hidden>
Date: 2016-06-15 22:42:01

Hi, Marc Singer wrote:
Yet, patch does apply. [...]
  patching file drivers/ide/ide-io.c
  Hunk #1 succeeded at 96 with fuzz 2 (offset -33 lines).
git-apply cowardly (but sensibly) refuses to apply patches with fuzz
(i.e., ignoring some supplied context lines). 

Fuzz indicates problems.

I'd suggest that you apply the patch to whatever version it is based on...
 o Is there a way to force git to apply and safe the rejects?
Well, you can use "patch -p1 ..." directly, and manually add the files it
created to the object cache. Personally I wouldn't, if at all possible.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
I couldn't remember things until I took that Sam Carnegie course.
		-- Bill Peterson, former Houston Oiler football coach

Re: Bootstrapping into git, commit gripes at me

From: Petr Baudis <hidden>
Date: 2016-06-15 22:42:01

Dear diary, on Sat, Jul 09, 2005 at 11:04:37PM CEST, I got a letter
where Matthias Urlichs [off-list ref] told me that...
quoted
 o Is there a way to force git to apply and safe the rejects?
Well, you can use "patch -p1 ..." directly, and manually add the files it
created to the object cache. Personally I wouldn't, if at all possible.
Or you can do cg-patch, which should handle that for you properly as
well.  I think the "no fuzz" approach is hyper-paranoid. I deal with
small or larger fuzz all the time when I'm reordering patches or
applying them to a few hours younger version than they were based on. I
think the restriction it imposes is overly draconian here and doesn't
trust the developer to know what he is doing as much as it should. (And
that's why cg-patch doesn't use git-apply. ;-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
<Espy> be careful, some twit might quote you out of context..
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help