From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Ori Avtalion <ori@avtalion.name>, git@vger.kernel.org
Subject: Re: git-apply that handles rejects like merge conflicts
Date: Tue, 8 Nov 2011 00:46:43 -0500 [thread overview]
Message-ID: <20111108054643.GC29643@sigill.intra.peff.net> (raw)
In-Reply-To: <7v4nyf1opf.fsf@alter.siamese.dyndns.org>
On Mon, Nov 07, 2011 at 03:45:48PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > In the general case, you can't represent all failed hunks with conflict
> > markers, can you?
>
> Conflict markers come from the use of a 3-way merge, and if you were to do
> a 3-way merge, by definition, you would need some way to tell where the
> preimage of the patch and the target tree you are attempting to apply the
> patch forked from. That's done by fall-back-3way in "am -3".
>
> You _could_ lift that logic out of "am -3", but I do not think it is worth
> the effort to do so (IOW, I do not see a reason to avoid "am -3").
I think it would purely be "I have a patch produced by git diff, not by
git format-patch". If you want to use "am -3", you would have to dress
up your patch with mail headers.
In practice, this doesn't come up much for me. I think I was using "git
diff >patch" as a poor-man's stash (and I did just stick some fake
headers in, and "git reset HEAD^" afterwards). But maybe other workflows
deal with this more.
But I think there are two questions:
1. Should am's 3-way fallback be made more easily available to users
of regular "apply"?
2. Short of doing a 3-way merge, are there better ways to represent
failed hunks in the patch target itself, rather than saving ".rej"
files?
I'm actually not sure which one Ori was asking about.
-Peff
next prev parent reply other threads:[~2011-11-08 5:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 22:10 git-apply that handles rejects like merge conflicts Ori Avtalion
2011-11-07 22:55 ` Jeff King
2011-11-07 23:18 ` Ori Avtalion
2011-11-07 23:45 ` Junio C Hamano
2011-11-08 5:46 ` Jeff King [this message]
2011-11-08 6:15 ` Junio C Hamano
2011-11-08 20:50 ` Ori Avtalion
2011-11-08 21:00 ` Jeff King
2011-11-08 8:52 ` Bert Wesarg
2011-11-08 16:10 ` Jeff King
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=20111108054643.GC29643@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ori@avtalion.name \
/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).