All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: "Martin Langhoff" <martin.langhoff@gmail.com>
Cc: "Junio C Hamano" <junkio@cox.net>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"David Lang" <david.lang@digitalinsight.com>,
	git@vger.kernel.org
Subject: Re: merge strategy request
Date: Sun, 25 Mar 2007 16:44:52 -0700	[thread overview]
Message-ID: <7vejnc28i3.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <46a038f90703251634t2ab6a455t382ebe29cdb53667@mail.gmail.com> (Martin Langhoff's message of "Mon, 26 Mar 2007 11:34:29 +1200")

"Martin Langhoff" <martin.langhoff@gmail.com> writes:

> Would it be possible to have an env var (GIT_MERGE) that can be used
> to call an arbitrary script with merge/diff3 semantics instead of
> using the internal 3-way merge? That way we could do syntax-specific
> merges (ignore comments/whitespace, for example).

I do not think such a patch is hard, as calling external merge
for file-level merge is what we used to do.  It's just a matter
of resurrecting the code we threw away and making it be called
conditionally.

But a more interesting point is "under what condition".  If the
condition is "when GIT_MERGE environment is defined", it is not
much better than what Dscho suggested, as the external merger
would be called for all paths.  We would want a mechanism to
decide use of such a specialized merge backend for special
cases, which is where gitattributes comes into the picture.
Especially because there would be one specialized to merge xml
documents, one to merge gimp xcf files, and another to merge
gentoo configuration files (or whatever the original thread
starter wanted).

> i would surely have a use for it, as sometimes my internal team is not
> _that_ good about trimming whitespace, and we have merges that succeed
> except for their whitespace conflicts.

I know Linus does not like applying patches with whitespace
fuzziness, but I personally think a merge that ignores
whitespace changes would be a useful thing to have, without
having to call an external specialized merge backend. In other
words, I do not think it is so special a thing to want to, but
it is rather an unfortunate norm.  I am not opposed to give
git-merge-recursive a command line option to tell it to merge
ignoring the whitespace-only changes, when it does the 3-way
file-level merge internally.

There is a small detail of how to pass such a command line
option to git-merge-$strategy backends, though.

  parent reply	other threads:[~2007-03-25 23:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-24 22:46 merge strategy request David Lang
2007-03-25  1:20 ` Johannes Schindelin
2007-03-25  1:18   ` David Lang
2007-03-25  4:31   ` Linus Torvalds
2007-03-25  6:25     ` David Lang
2007-03-25  7:17     ` Junio C Hamano
2007-03-25 23:34       ` Martin Langhoff
2007-03-25 23:16         ` David Lang
2007-03-25 23:44         ` Junio C Hamano [this message]
2007-03-26  0:11           ` Martin Langhoff

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=7vejnc28i3.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=david.lang@digitalinsight.com \
    --cc=git@vger.kernel.org \
    --cc=martin.langhoff@gmail.com \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.