git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Different result with `git apply` and `patch`
@ 2015-07-08 17:50 Benjamin Poirier
  0 siblings, 0 replies; only message in thread
From: Benjamin Poirier @ 2015-07-08 17:50 UTC (permalink / raw)
  To: git

Hi,

Is it expected that `git apply` and `patch` produce a different result
when given a patch that applies cleanly but with offsets?

Specifically, using the source file and patch file found here:
https://gist.github.com/benthaman/d4e80e1e2e5e0273f874
https://gist.github.com/benthaman/d48d017179a8292c3f75

ben@f1:/tmp/report$ mkdir p g
ben@f1:/tmp/report$ cp ib_isert.c p
ben@f1:/tmp/report$ cp ib_isert.c g
ben@f1:/tmp/report$ cd p/
ben@f1:/tmp/report/p$ patch -p5 < ../0123-IB-isert-pass-scatterlist-instead-of-cmd-to-fast_reg.patch
patching file ib_isert.c
Hunk #1 succeeded at 2322 (offset 131 lines).
Hunk #2 succeeded at 2408 (offset 131 lines).
Hunk #3 succeeded at 2474 (offset 131 lines).
ben@f1:/tmp/report/p$ cd ../g
ben@f1:/tmp/report/g$ git apply -p5 -v < ../0123-IB-isert-pass-scatterlist-instead-of-cmd-to-fast_reg.patch
Checking patch ib_isert.c...
Hunk #1 succeeded at 2322 (offset 131 lines).
Hunk #2 succeeded at 2199 (offset -78 lines).
Hunk #3 succeeded at 2474 (offset 131 lines).
Applied patch ib_isert.c cleanly.


ben@f1:/tmp/report$ git --version
git version 2.4.3
ben@f1:/tmp/report$ patch --version
GNU patch 2.7.1
[...]

I see why it happens, but I'd like the two tools to produce the same
result!

Thanks,
-Benjamin

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-08 17:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 17:50 Different result with `git apply` and `patch` Benjamin Poirier

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