From: Benjamin Poirier <bpoirier@suse.com>
To: git@vger.kernel.org
Subject: Different result with `git apply` and `patch`
Date: Wed, 8 Jul 2015 10:50:34 -0700 [thread overview]
Message-ID: <20150708175034.GA16759@f1.synalogic.ca> (raw)
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
reply other threads:[~2015-07-08 17:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150708175034.GA16759@f1.synalogic.ca \
--to=bpoirier@suse.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).