From: Theodore Tso <tytso@mit.edu>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add git-mergetool to run an appropriate merge conflict resolution program
Date: Tue, 6 Mar 2007 07:40:02 -0500 [thread overview]
Message-ID: <20070306124002.GA18370@thunk.org> (raw)
In-Reply-To: <7vr6s3sz8r.fsf@assigned-by-dhcp.cox.net>
On Mon, Mar 05, 2007 at 09:43:48PM -0800, Junio C Hamano wrote:
> "Theodore Ts'o" <tytso@mit.edu> writes:
>
> > +git-mergetool(1)
> > +================
> > +
> > +NAME
> > +----
> > +git-mergetool - Forward-port local commits to the updated upstream head
> > +
>
> Hmph. We already have a tool to achieve such a goal, and that
> is called git-rebase. Why would we want your program? ;-)
Oops, sorry, I thought I had fixed that. Guess you figured out which
program I used as a man page template, huh? :-)
> > +# This file is licensed under the GPL v2, or a later version
> > +# at the discretion of Linus Torvalds.
>
> Heh ;-).
Hey, that's what the COPYING file requested, and it was late when I
started doing the git package integration, hence the stupid think-o
with the man page. :-)
I assume you would prefer that it read Junio instead? Should we
change the COPYING while we're at it, perhaps after consulting with
Linus since he still owns so a fair amount of the copyright on git?
It seems that if we're going to pre-collect permissions to move to
GPLv3, it ought to be either you or him....
> Do we want to do this by hand ourselves, or dot-source sh-setup
> like others? You would also get die() for free.
Good point, I'll use git-sh-setup.
> You should be able to set IFS to exclude SP and then you only
> have to say you do not support LF and HT, both of which are much
> less likely than SP to be in the pathname.
Do we have any coding guidelines about what characters we have to
support in filenames? I had assumed that we should support at least
SP and HT, but life does get easier if we don't need to worry about HT.
> > + mv "$path" "$BACKUP"
> > + cp "$BACKUP" "$path"
>
> What if $path is a symlink blob? ;-)
Yeah, I need to add special case code for symlinks.
> > + case "$merge_tool" in
> > + kdiff3)
> > ...
> > + tkdiff)
> > ...
> > + meld)
> > ...
> > + xxdiff)
> > ...
>
> It is depressing to see that the differences between the command
> lines of these have to be much larger than just the command name
> and order of three (or four if we count the result) paths
> parameters.
Yep, it is depressing. There is no standard calling convention, and
there is no standard exit status convention, either. Hence the
requirement for meld and xxdiff to check to see if the file has
changed. Grump....
> > + xxdiff -X --show-merged-pane \
> > + -R 'Accel.SaveAsMerged: "Ctrl-S"' \
> > + -R 'Accel.Search: "Ctrl+F"' \
> > + -R 'Accel.SearchForward: "Ctrl-G"' \
>
> Do these configuration belong to individual scripts like this?
The problem is that if you don't do this, using xxdiff is user-hostile
in the extreme. The problem isn't so much that the save command has
no accelerators, but the Save menu gives you five (5!) save options.
You can save the merged file as:
* The right file
* The middle file
* The left file
* The file that was specified as the output on the command-line
* Some user-specified file (save-as)
So without those resource changes, the user would have to click on the
File menu, and drag down to the "correct" save option or the file with
the resolved merge conflicts would get saved to some random place.
Gaaah. I thought xxdiff was user hostile in the extreme, but Martin
Langhoff really wanted it, and he was right that xxdiff will give you
a built-in character-diff so you can see what changed on the
individual line. So the resource changes were in my opinion the
minimum necessary so that the user would have some chance of seeing
which one of the five save options would actually do the right thing
with respect to git-mergetool.
> > + echo "No available merge tools available."
>
> Curious choice of words...
>
Yeah, that should probably read "merge conflict resolution programs",
even though that's a lot more words.
> > +if test $# -eq 0 ; then
> > + files=`git ls-files -u --abbrev=8 | colrm 1 24 | sort -u`
>
> Careful. I think --abbrev=8 just means use at least 8 but more
> as needed to make them unique. sed -e 's/^[^ ]* //'
> (whitespace are HTs) would be safer and simpler, as you are not
> dealing with a pathname that has LF in it anyway.
OK, I can do that. Alternatively I guess I could submit a patch which
caused git-ls-files to only list the files that still needed merging.
(i.e., git-ls-files -u --nostage".) Do you have any preferences?
- Ted
next prev parent reply other threads:[~2007-03-06 12:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-06 5:07 [PATCH] Add git-mergetool to run an appropriate merge conflict resolution program Theodore Ts'o
2007-03-06 5:43 ` Junio C Hamano
2007-03-06 12:40 ` Theodore Tso [this message]
2007-03-06 22:55 ` Linus Torvalds
2007-03-06 23:02 ` Junio C Hamano
2007-03-29 3:58 ` Junio C Hamano
2007-03-29 14:20 ` Theodore Tso
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=20070306124002.GA18370@thunk.org \
--to=tytso@mit.edu \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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.