From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Waitz <tali@admingilde.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
git@vger.kernel.org
Subject: Re: [PATCH 0/2] Custom low-level merge driver support.
Date: Wed, 18 Apr 2007 10:10:18 -0700 [thread overview]
Message-ID: <7vslaxhamd.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <alpine.LFD.0.98.0704180910120.2828@woody.linux-foundation.org> (Linus Torvalds's message of "Wed, 18 Apr 2007 09:16:31 -0700 (PDT)")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Wed, 18 Apr 2007, Martin Waitz wrote:
>>
>> > [merge.driver]
>> > ancient = merge %A %O %B
>>
>> or
>>
>> [merge "ancient"]
>> driver = merge %A %O %B
>
> Much better. That format also allows you to add extra flags if you want.
>
> For example, it might be useful to add something like
>
> [merge "ancient"]
> name = external three-way merge
> driver = merge %A %O %B
>
> so that you could make the merge process actually say what it is doing
> when it's merging things. Wouldn't it be nice to see
>
> merging file xyzzy using external three-way merge
> merging file fax.doc using word file merge
> ..
>
> when these things trigger?
>
> So even if we do *not* care about the name, this kind of config structure
> is just more flexible.
Yes.
While I agree with all of the above, I am currently fighting
with a back-to-drawing-board design problem.
The series made the low-level 3-way merge machinery
customizable, which is a progress, but I think merge-recursive
needs a hook to affect middle-level merge decision, similar to
what git-merge-one-file does.
I wanted to use 'ours' merge for RelNotes, which typically
points at the release notes being prepared for the next release
from the branch (Documentation/RelNotes-1.5.1.1.txt for 'maint',
and Documentation/RelNotes-1.5.2.txt for 'master'). As I never
merge 'master' into 'maint', using 'ours' merge for that path is
the right thing to do in this case.
But merge-recursive has a built-in middle-level decision that
makes a conflicting symlink modification never go through the
low-level 3-way merge codepath.
This was originally not a problem, as the low-level 3-way merge
used to be always "textual merge" that would never make sense
for symbolic links, but once we allow low-level merge driver
that could be "pick one of branches", it becomes needless
constraints.
For now, I'd stop at pointing this issue in this message, and
finish up the configurability of low-level merge driver first
and merge that to 'next'.
But I *think* we would end up revising the driver definition to
take more than %A %O %B and allow it to do more than the
low-level decision.
Perhaps...
(in .gitattributes)
RelNotes merge=ours
(in .git/config)
[merge "ours"]
name = middle level 'ours' merge driver
driver = exit 0
middlelevel
when "merge.$name.middlelevel" boolean is set, it would forbid
process_entry() to make the 'git-merge-one-file' policy decision
and always call the driver with these in addition to the %O %A
%B:
%OSHA1 object name for ancestor version (or 0{40} for missing)
%OMODE mode bits for ancestor version (or 0{6} for missing)
The driver should be able to express the merge cleanliness via
exit status, and the resulting (potentially partial) merge
result blob via %A as the low-level driver, but in addition to
them it needs to be able to say "the merge result is to remove
that path". I haven't figured out what that interface should
be; we could designate one special exit code to signal that,
perhaps "exit 42", but that feels hacky.
In any case, making [merge "driver-name"] section with 'driver'
variable leaves the door open for such extension in a backward
compatible way by leaving room to add 'middlelevel' boolean like
the above outline, so I'd stop worrying about this for now,
without doing anything further.
next prev parent reply other threads:[~2007-04-18 17:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-18 9:21 [PATCH 0/2] Custom low-level merge driver support Junio C Hamano
2007-04-18 9:21 ` [PATCH 1/2] " Junio C Hamano
2007-04-18 10:36 ` Johannes Sixt
2007-04-18 10:55 ` Johannes Schindelin
2007-04-18 9:21 ` [PATCH 2/2] Allow the default low-level merge driver to be configured Junio C Hamano
2007-04-18 10:48 ` [PATCH 0/2] Custom low-level merge driver support Johannes Schindelin
2007-04-18 15:34 ` Martin Waitz
2007-04-18 15:56 ` Junio C Hamano
2007-04-18 16:08 ` Martin Waitz
2007-04-18 16:16 ` Linus Torvalds
2007-04-18 17:10 ` Junio C Hamano [this message]
2007-04-18 18:45 ` Linus Torvalds
2007-04-18 19:00 ` Junio C Hamano
2007-04-18 19:23 ` Junio C Hamano
2007-04-18 19:43 ` Linus Torvalds
2007-04-18 19:51 ` Linus Torvalds
2007-04-18 20:13 ` Junio C Hamano
2007-04-18 20:35 ` Linus Torvalds
2007-04-18 20:09 ` David Lang
2007-04-18 21:01 ` Junio C Hamano
2007-04-19 7:52 ` Martin Waitz
2007-04-19 8:08 ` Junio C Hamano
2007-04-18 18:28 ` [PATCH] Custom low-level merge driver: change the configuration scheme Junio C Hamano
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=7vslaxhamd.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=tali@admingilde.org \
--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 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).