From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Stephen Bash <bash@genarts.com>
Subject: Re: [PATCH 2/2] attr: "binary" attribute should choose built-in "binary" merge driver
Date: Wed, 12 Sep 2012 09:17:02 -0400 [thread overview]
Message-ID: <20120912131702.GA13710@sigill.intra.peff.net> (raw)
In-Reply-To: <7vk3vzfwme.fsf@alter.siamese.dyndns.org>
On Wed, Sep 12, 2012 at 01:55:53AM -0700, Junio C Hamano wrote:
> > Yeah, that seems like the obviously correct thing to do. In practice,
> > most files would end up in the first few lines of ll_xdl_merge checking
> > buffer_is_binary anyway, so I think this would really only make a
> > difference when our "is it binary?" heuristic guesses wrong.
>
> You made me look at that part again and then made me notice
> something unrelated.
>
> if (buffer_is_binary(orig->ptr, orig->size) ||
> buffer_is_binary(src1->ptr, src1->size) ||
> buffer_is_binary(src2->ptr, src2->size)) {
> warning("Cannot merge binary files: %s (%s vs. %s)",
> path, name1, name2);
> return ll_binary_merge(drv_unused, result,
> path,
> orig, orig_name,
> src1, name1,
> src2, name2,
> opts, marker_size);
> }
>
> Given that we now may know how to merge these things, the
> unconditional warning feels very wrong.
>
> Perhaps something like this makes it better.
>
> A path that is explicitly marked as binary did not get any such
> warning, but it will start to get warned just like a path that was
> auto-detected to be a binary.
>
> It is a behaviour change, but I think it is a good one that makes
> two cases more consistent.
>
> And we won't see the warning when -Xtheirs/-Xours large sledgehammer
> is in use, which tells us how to resolve these things "cleanly".
Yeah, I think it is the right thing to do. I noticed that the warning
would not trigger in the "-merge" case and wondered if it should, but
figured it was not a big deal either way.
However, I agree it is very bad for it to trigger with -Xours/theirs,
and that is worth fixing. That it triggers in the "-merge" case
afterwards is a slight bonus.
-Peff
next prev parent reply other threads:[~2012-09-12 13:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1799969825.275125.1347028392272.JavaMail.root@genarts.com>
2012-09-07 14:48 ` Binary file-friendly merge -Xours or -Xtheirs? Stephen Bash
2012-09-07 21:47 ` Junio C Hamano
2012-09-09 4:40 ` [PATCH 0/2] Teaching -Xours/-Xtheirs to binary ll-merge driver Junio C Hamano
2012-09-09 4:40 ` [PATCH 1/2] merge: teach " Junio C Hamano
2012-09-09 4:40 ` [PATCH 2/2] attr: "binary" attribute should choose built-in "binary" merge driver Junio C Hamano
2012-09-10 14:03 ` Jeff King
2012-09-12 8:55 ` Junio C Hamano
2012-09-12 12:58 ` Stephen Bash
2012-09-12 17:01 ` Junio C Hamano
2012-09-12 17:50 ` Stephen Bash
2012-09-12 13:17 ` Jeff King [this message]
2012-09-09 14:30 ` [PATCH 0/2] Teaching -Xours/-Xtheirs to binary ll-merge driver Stephen Bash
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=20120912131702.GA13710@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=bash@genarts.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).