From: "Catalin Marinas" <catalin.marinas@gmail.com>
To: "Junio C Hamano" <junkio@cox.net>
Cc: "Linus Torvalds" <torvalds@osdl.org>, git@vger.kernel.org
Subject: Re: [PATCH] Add a test-case for git-apply trying to add an ending line
Date: Wed, 24 May 2006 14:32:01 +0100 [thread overview]
Message-ID: <b0943d9e0605240632t4189f8d0yfdbab111c83f0426@mail.gmail.com> (raw)
In-Reply-To: <7v8xosqaqm.fsf@assigned-by-dhcp.cox.net>
On 24/05/06, Junio C Hamano <junkio@cox.net> wrote:
> I'd admit that trying to apply a patch without context like the
> above example _is_ insane, and I realize that I am making this
> problem unsolvable by refusing the heuristics to consider that
> the patch is anchored at the end when we do not see any trailing
> context. But somehow it feels wrong...
The reason I sent you this test is that GNU patch fails to apply the
diff but git-apply succeeds (and I thought git-apply is more
restrictive).
When there are context lines either before or after the "+" line, it
should be OK to assume that the diff has context and therefore the EOF
should be considered.
If there are no context lines at all, the diff is either without
context or it is meant to patch an empty file. The latter is safer and
probably valid for most of the cases but if you have a patch without
context, you could explicitely pass the -C0 option to git-apply.
--
Catalin
next prev parent reply other threads:[~2006-05-24 13:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-23 21:48 [PATCH] Add a test-case for git-apply trying to add an ending line Catalin Marinas
2006-05-24 0:31 ` Junio C Hamano
2006-05-24 1:09 ` Junio C Hamano
2006-05-24 1:09 ` Junio C Hamano
2006-05-24 2:08 ` Linus Torvalds
2006-05-24 2:17 ` Linus Torvalds
2006-05-24 4:59 ` Junio C Hamano
2006-05-24 13:32 ` Catalin Marinas [this message]
2006-05-24 14:49 ` Linus Torvalds
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=b0943d9e0605240632t4189f8d0yfdbab111c83f0426@mail.gmail.com \
--to=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.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).