{"thread":{"id":"10051","subject":"Mergetool generating blank files (1.5.3)","startedAt":"2007-09-27T18:31:19Z","lastAt":"2007-09-28T08:43:37Z","messageCount":28,"participants":["Kelvie Wong","Pierre Habouzit","Russ Brown","Jeff King","Junio C Hamano","Theodore Tso","Peter Baumann","David Kastrup","David Kågedal"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"54177","messageId":"94ccbe710709271131o620bf1far8893328ce98f0ba4@mail.gmail.com","threadId":"10051","inReplyTo":null,"subject":"Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-27T18:31:19Z","receivedAt":"2007-09-27T18:31:19Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"At work, I've been using a git-svn import for my daily workflow (still\nsomewhat of a git newbie, but now has come to the point where it's\ntough to work without it), and while rebasing from svn (on a rather\nold branch), I found that the mergetool option does not work too well\nfor me.\n\nI am using version 1.5.3 and I have tried all of the different diff\ntools (save opendiff) that are supported by git -- but in the middle\nof a rebase, whenever I run the mergetool, the LOCAL, REMOTE, and BASE\ntemporary files that are created are all empty.  The BACKUP file\nremains, and still has the proper 3-way-merge conflict syntax (with\n<<<< ==== >>>>) and such, but the other files are all empty -- and\nthus the mergetool of choice does not read it (it shows up empty there\ntoo, of course).\n\nWhat could I do to fix this?  I'm confident that there are conflicts\n(git tells me so, and I end up manually going through all the files in\nemacs anyways, but it's very tedious); or is there another tool that\nreads the 3-way-merge syntax (the < = >'s) and lets me pick one or the\nother, or do I have to write my own?\n\nI know there's just something funky on my system, because someone else\ndoesn't seem to have this problem on his computer -- maybe it is\nbecause I use the svn rebase, but it does that when I rebase onto\nanother branch too.\n\nThanks.\n\n-- \nKelvie\n"},{"id":"54179","messageId":"20070927185707.GC12427@artemis.corp","threadId":"10051","inReplyTo":"94ccbe710709271131o620bf1far8893328ce98f0ba4@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2007-09-27T18:57:07Z","receivedAt":"2007-09-27T18:57:07Z","isPatch":false,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, Sep 27, 2007 at 06:31:19PM +0000, Kelvie Wong wrote:\n> At work, I've been using a git-svn import for my daily workflow (still\n> somewhat of a git newbie, but now has come to the point where it's\n> tough to work without it), and while rebasing from svn (on a rather\n> old branch), I found that the mergetool option does not work too well\n> for me.\n\n  Which tool are you using ? kdiff3 ? I've noticed that it often fails\nmiserably, or worse, create bad merges silentely with it.\n\n  And as none of the other merge tool that are supported are able to\neither do 3way merges, or have a decent UI (that definitely seems to be\nexclusive features) I've given up on git-mergetool (and to be fair, it\nsucks, because it could be _sooo_ useful sometimes).\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"54181","messageId":"46FBFDD7.1080300@gmail.com","threadId":"10051","inReplyTo":"20070927185707.GC12427@artemis.corp","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Russ Brown","fromEmail":"pickscrape@gmail.com","sentAt":"2007-09-27T19:00:39Z","receivedAt":"2007-09-27T19:00:39Z","isPatch":false,"sender":{"key":"pickscrape@gmail.com","avatar":null},"body":"Pierre Habouzit wrote:\n> On Thu, Sep 27, 2007 at 06:31:19PM +0000, Kelvie Wong wrote:\n>> At work, I've been using a git-svn import for my daily workflow (still\n>> somewhat of a git newbie, but now has come to the point where it's\n>> tough to work without it), and while rebasing from svn (on a rather\n>> old branch), I found that the mergetool option does not work too well\n>> for me.\n> \n>   Which tool are you using ? kdiff3 ? I've noticed that it often fails\n> miserably, or worse, create bad merges silentely with it.\n> \n>   And as none of the other merge tool that are supported are able to\n> either do 3way merges, or have a decent UI (that definitely seems to be\n> exclusive features) I've given up on git-mergetool (and to be fair, it\n> sucks, because it could be _sooo_ useful sometimes).\n> \n\nWhat about meld? That does 3-way merge, and the UI is fine.\n\n-- \n\nRuss\n"},{"id":"54184","messageId":"20070927191125.GD12427@artemis.corp","threadId":"10051","inReplyTo":"46FBFDD7.1080300@gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2007-09-27T19:11:25Z","receivedAt":"2007-09-27T19:11:25Z","isPatch":false,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, Sep 27, 2007 at 07:00:39PM +0000, Russ Brown wrote:\n> Pierre Habouzit wrote:\n> > On Thu, Sep 27, 2007 at 06:31:19PM +0000, Kelvie Wong wrote:\n> >> At work, I've been using a git-svn import for my daily workflow (still\n> >> somewhat of a git newbie, but now has come to the point where it's\n> >> tough to work without it), and while rebasing from svn (on a rather\n> >> old branch), I found that the mergetool option does not work too well\n> >> for me.\n> > \n> >   Which tool are you using ? kdiff3 ? I've noticed that it often fails\n> > miserably, or worse, create bad merges silentely with it.\n> > \n> >   And as none of the other merge tool that are supported are able to\n> > either do 3way merges, or have a decent UI (that definitely seems to be\n> > exclusive features) I've given up on git-mergetool (and to be fair, it\n> > sucks, because it could be _sooo_ useful sometimes).\n> > \n> \n> What about meld? That does 3-way merge, and the UI is fine.\n\n  Indeed, it seems that since the last time I tested it, it now does\ndiff3 merging. I should reevaluate it :)\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"54185","messageId":"20070927191201.GA31807@sigill.intra.peff.net","threadId":"10051","inReplyTo":"20070927185707.GC12427@artemis.corp","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-09-27T19:12:01Z","receivedAt":"2007-09-27T19:12:01Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Sep 27, 2007 at 08:57:07PM +0200, Pierre Habouzit wrote:\n\n>   Which tool are you using ? kdiff3 ? I've noticed that it often fails\n> miserably, or worse, create bad merges silentely with it.\n> \n>   And as none of the other merge tool that are supported are able to\n> either do 3way merges, or have a decent UI (that definitely seems to be\n> exclusive features) I've given up on git-mergetool (and to be fair, it\n> sucks, because it could be _sooo_ useful sometimes).\n\nHuh? I use xxdiff all the time, and it works fine.\n\n-Peff\n"},{"id":"54186","messageId":"20070927191614.GE12427@artemis.corp","threadId":"10051","inReplyTo":"20070927191201.GA31807@sigill.intra.peff.net","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2007-09-27T19:16:14Z","receivedAt":"2007-09-27T19:16:14Z","isPatch":false,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, Sep 27, 2007 at 07:12:01PM +0000, Jeff King wrote:\n> On Thu, Sep 27, 2007 at 08:57:07PM +0200, Pierre Habouzit wrote:\n> \n> >   Which tool are you using ? kdiff3 ? I've noticed that it often fails\n> > miserably, or worse, create bad merges silentely with it.\n> > \n> >   And as none of the other merge tool that are supported are able to\n> > either do 3way merges, or have a decent UI (that definitely seems to be\n> > exclusive features) I've given up on git-mergetool (and to be fair, it\n> > sucks, because it could be _sooo_ useful sometimes).\n> \n> Huh? I use xxdiff all the time, and it works fine.\n\n  I'm sorry but I find that the UI is terrible.\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"54188","messageId":"94ccbe710709271224rc65b6f4k8b68419629ed5b45@mail.gmail.com","threadId":"10051","inReplyTo":"20070927185707.GC12427@artemis.corp","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-27T19:24:38Z","receivedAt":"2007-09-27T19:24:38Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"I've tried all of the ones that were supported, the result is the same\n-- blank files in all three windows.\n\nIt is because git mergetool fails to generate these files for whatever\nreason (the filebasename.{REMOTE,LOCAL,BASE}.* files).  I don't know\nwhy this happens.\n\nAs for merge utilities, all I need is something that looks for the\nfirst <<<<<, and lets me choose which version I want (either top or\nbottom), plain and simple :/  I don't even need/want a gui.\n\nBut oh well, I guess the answer here is to write a script that does it.\n\nKelvie\n\nOn 9/27/07, Pierre Habouzit <madcoder@debian.org> wrote:\n> On Thu, Sep 27, 2007 at 06:31:19PM +0000, Kelvie Wong wrote:\n> > At work, I've been using a git-svn import for my daily workflow (still\n> > somewhat of a git newbie, but now has come to the point where it's\n> > tough to work without it), and while rebasing from svn (on a rather\n> > old branch), I found that the mergetool option does not work too well\n> > for me.\n>\n>   Which tool are you using ? kdiff3 ? I've noticed that it often fails\n> miserably, or worse, create bad merges silentely with it.\n>\n>   And as none of the other merge tool that are supported are able to\n> either do 3way merges, or have a decent UI (that definitely seems to be\n> exclusive features) I've given up on git-mergetool (and to be fair, it\n> sucks, because it could be _sooo_ useful sometimes).\n>\n> --\n> ·O·  Pierre Habouzit\n> ··O                                                madcoder@debian.org\n> OOO                                                http://www.madism.org\n>\n>\n\n\n-- \nKelvie\n"},{"id":"54192","messageId":"20070927194101.GA32572@sigill.intra.peff.net","threadId":"10051","inReplyTo":"20070927191614.GE12427@artemis.corp","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-09-27T19:41:01Z","receivedAt":"2007-09-27T19:41:01Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Sep 27, 2007 at 09:16:14PM +0200, Pierre Habouzit wrote:\n\n> > Huh? I use xxdiff all the time, and it works fine.\n> \n>   I'm sorry but I find that the UI is terrible.\n\nFair enough.\n\n-Peff\n"},{"id":"54196","messageId":"7vhclfubh5.fsf@gitster.siamese.dyndns.org","threadId":"10051","inReplyTo":"94ccbe710709271224rc65b6f4k8b68419629ed5b45@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-27T19:58:30Z","receivedAt":"2007-09-27T19:58:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kelvie Wong\" <kelvie@ieee.org> writes:\n\n> I've tried all of the ones that were supported, the result is the same\n> -- blank files in all three windows.\n>\n> It is because git mergetool fails to generate these files for whatever\n> reason (the filebasename.{REMOTE,LOCAL,BASE}.* files).  I don't know\n> why this happens.\n\nCan you run git-mergetool under \"sh -x\"?\n\nThat is,\n\n\t$ sh -x git-mergetool\n\naround ll.160-170 these files are created.\n"},{"id":"54197","messageId":"94ccbe710709271312k7eac8e35y353180596a0abc9a@mail.gmail.com","threadId":"10051","inReplyTo":"7vhclfubh5.fsf@gitster.siamese.dyndns.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-27T20:12:03Z","receivedAt":"2007-09-27T20:12:03Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"On 9/27/07, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Kelvie Wong\" <kelvie@ieee.org> writes:\n>\n> > I've tried all of the ones that were supported, the result is the same\n> > -- blank files in all three windows.\n> >\n> > It is because git mergetool fails to generate these files for whatever\n> > reason (the filebasename.{REMOTE,LOCAL,BASE}.* files).  I don't know\n> > why this happens.\n>\n> Can you run git-mergetool under \"sh -x\"?\n>\n> That is,\n>\n>         $ sh -x git-mergetool\n>\n> around ll.160-170 these files are created.\n>\n\n#######################################\n$ sh -x /usr/local/bin/git-mergetool --tool=meld\n+ USAGE=[--tool=tool] [file to merge] ...\n+ SUBDIRECTORY_OK=Yes\n+ . git-sh-setup\n+ unset CDPATH\n+ [ -z  ]\n+ LONG_USAGE=Usage: /usr/local/bin/git-mergetool [--tool=tool] [file\nto merge] ...\n+ [ -z Yes ]\n+ git rev-parse --git-dir\n+ GIT_DIR=/home/kelvie/src/trunk/.git\n+ test -n /home/kelvie/src/trunk/.git\n+ cd /home/kelvie/src/trunk/.git\n+ pwd\n+ GIT_DIR=/home/kelvie/src/trunk/.git\n+ : /home/kelvie/src/trunk/.git/objects\n+ require_work_tree\n+ git rev-parse --is-inside-work-tree\n+ test true = true\n+ expr z--tool=meld : z-[^=]*=\\(.*\\)\n+ merge_tool=meld\n+ shift\n+ break\n+ test -z meld\n+ test -z meld\n+ type meld\n+ test 0 -eq 0\n+ git ls-files -u\n+ sed -e s/^[^  ]*      //\n+ sort -u\n+ files=fmeprompter/src/qfmeparameterfloat.cpp\nfmeprompter/src/qfmeparameterfloat.h\nfmeprompter/src/qfmeparameterinteger.cpp\nfmeprompter/src/qfmeparameterinteger.h\n+ test -z fmeprompter/src/qfmeparameterfloat.cpp\nfmeprompter/src/qfmeparameterfloat.h\nfmeprompter/src/qfmeparameterinteger.cpp\nfmeprompter/src/qfmeparameterinteger.h\n+ echo Merging the files: fmeprompter/src/qfmeparameterfloat.cpp\nfmeprompter/src/qfmeparameterfloat.h\nfmeprompter/src/qfmeparameterinteger.cpp\nfmeprompter/src/qfmeparameterinteger.h\nMerging the files: fmeprompter/src/qfmeparameterfloat.cpp\nfmeprompter/src/qfmeparameterfloat.h\nfmeprompter/src/qfmeparameterinteger.cpp\nfmeprompter/src/qfmeparameterinteger.h\n+ git ls-files -u\n+ sed -e s/^[^  ]*      //\n+ sort -u\n+ read i\n+ printf \\n\n\n+ merge_file fmeprompter/src/qfmeparameterfloat.cpp\n+ path=fmeprompter/src/qfmeparameterfloat.cpp\n+ git ls-files -u -- fmeprompter/src/qfmeparameterfloat.cpp\n+ f=100644 bd66831cc4c3fb2907bba0fa9bef6d3e696bf0a3 1\nfmeprompter/src/qfmeparameterfloat.cpp\n100644 10026c1391fc34485b54727f831ebecfde8711a5 2\nfmeprompter/src/qfmeparameterfloat.cpp\n100644 0d2e9decf73ae5f5e4143f3181b7c8435c20416c 3\nfmeprompter/src/qfmeparameterfloat.cpp\n+ test -z 100644 bd66831cc4c3fb2907bba0fa9bef6d3e696bf0a3 1\nfmeprompter/src/qfmeparameterfloat.cpp\n100644 10026c1391fc34485b54727f831ebecfde8711a5 2\nfmeprompter/src/qfmeparameterfloat.cpp\n100644 0d2e9decf73ae5f5e4143f3181b7c8435c20416c 3\nfmeprompter/src/qfmeparameterfloat.cpp\n+ BACKUP=fmeprompter/src/qfmeparameterfloat.cpp.BACKUP.4697\n+ LOCAL=fmeprompter/src/qfmeparameterfloat.cpp.LOCAL.4697\n+ REMOTE=fmeprompter/src/qfmeparameterfloat.cpp.REMOTE.4697\n+ BASE=fmeprompter/src/qfmeparameterfloat.cpp.BASE.4697\n+ mv -- fmeprompter/src/qfmeparameterfloat.cpp\nfmeprompter/src/qfmeparameterfloat.cpp.BACKUP.4697\n+ cp -- fmeprompter/src/qfmeparameterfloat.cpp.BACKUP.4697\nfmeprompter/src/qfmeparameterfloat.cpp\n+ git ls-files -u -- fmeprompter/src/qfmeparameterfloat.cpp\n+ awk {if ($3==1) print $1;}\n+ base_mode=100644\n+ git ls-files -u -- fmeprompter/src/qfmeparameterfloat.cpp\n+ awk {if ($3==2) print $1;}\n+ local_mode=100644\n+ git ls-files -u -- fmeprompter/src/qfmeparameterfloat.cpp\n+ awk {if ($3==3) print $1;}\n+ remote_mode=100644\n+ base_present\n+ test -n 100644\n+ git cat-file blob :1:fmeprompter/src/qfmeparameterfloat.cpp\n+ local_present\n+ test -n 100644\n+ git cat-file blob :2:fmeprompter/src/qfmeparameterfloat.cpp\n+ remote_present\n+ test -n 100644\n+ git cat-file blob :3:fmeprompter/src/qfmeparameterfloat.cpp\n+ test -z 100644 -o -z 100644\n+ is_symlink 100644\n+ test 100644 = 120000\n+ is_symlink 100644\n+ test 100644 = 120000\n+ echo Normal merge conflict for 'fmeprompter/src/qfmeparameterfloat.cpp':\nNormal merge conflict for 'fmeprompter/src/qfmeparameterfloat.cpp':\n+ describe_file 100644 local fmeprompter/src/qfmeparameterfloat.cpp.LOCAL.4697\n+ mode=100644\n+ branch=local\n+ file=fmeprompter/src/qfmeparameterfloat.cpp.LOCAL.4697\n+ printf   {%s}:  local\n  {local}: + test -z 100644\n+ is_symlink 100644\n+ test 100644 = 120000\n+ base_present\n+ test -n 100644\n+ echo modified\nmodified\n+ describe_file 100644 remote fmeprompter/src/qfmeparameterfloat.cpp.REMOTE.4697\n+ mode=100644\n+ branch=remote\n+ file=fmeprompter/src/qfmeparameterfloat.cpp.REMOTE.4697\n+ printf   {%s}:  remote\n  {remote}: + test -z 100644\n+ is_symlink 100644\n+ test 100644 = 120000\n+ base_present\n+ test -n 100644\n+ echo modified\nmodified\n+ printf Hit return to start merge resolution tool (%s):  meld\nHit return to start merge resolution tool (meld): + read ans\n\n+ touch fmeprompter/src/qfmeparameterfloat.cpp.BACKUP.4697\n+ meld -- fmeprompter/src/qfmeparameterfloat.cpp.LOCAL.4697\nfmeprompter/src/qfmeparameterfloat.cpp\nfmeprompter/src/qfmeparameterfloat.cpp.REMOTE.4697\n\n\nAnd then meld starts up, with the original file in the middle, and two\nblank files on the side, LOCAL and REMOTE respectively.\n-- \nKelvie\n"},{"id":"54198","messageId":"7vd4w3ua2j.fsf@gitster.siamese.dyndns.org","threadId":"10051","inReplyTo":"94ccbe710709271312k7eac8e35y353180596a0abc9a@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-27T20:28:52Z","receivedAt":"2007-09-27T20:28:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kelvie Wong\" <kelvie@ieee.org> writes:\n\n> And then meld starts up, with the original file in the middle, and two\n> blank files on the side, LOCAL and REMOTE respectively.\n\nWild guess.  Are you running this from a subdirectory?  I have a\nmild suspicion that mergetool is not subdirectory safe.  Can you\ntry running it from the toplevel of the work tree?\n"},{"id":"54200","messageId":"94ccbe710709271338u79ba89beh5a637bf84f8edf44@mail.gmail.com","threadId":"10051","inReplyTo":"7vd4w3ua2j.fsf@gitster.siamese.dyndns.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-27T20:38:19Z","receivedAt":"2007-09-27T20:38:19Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"Egads, it's alive!\n\nI was in a subdirectory (most of my work is in that one subdirectory\nanyways :p), but running it on the top level did indeed work as\nexpected.\n\nThanks,\nKelvie\n\nOn 9/27/07, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Kelvie Wong\" <kelvie@ieee.org> writes:\n>\n> > And then meld starts up, with the original file in the middle, and two\n> > blank files on the side, LOCAL and REMOTE respectively.\n>\n> Wild guess.  Are you running this from a subdirectory?  I have a\n> mild suspicion that mergetool is not subdirectory safe.  Can you\n> try running it from the toplevel of the work tree?\n>\n>\n\n\n-- \nKelvie\n"},{"id":"54202","messageId":"7v8x6ru97z.fsf@gitster.siamese.dyndns.org","threadId":"10051","inReplyTo":"94ccbe710709271338u79ba89beh5a637bf84f8edf44@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-27T20:47:12Z","receivedAt":"2007-09-27T20:47:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kelvie Wong\" <kelvie@ieee.org> writes:\n\n> Egads, it's alive!\n>\n> I was in a subdirectory (most of my work is in that one subdirectory\n> anyways :p), but running it on the top level did indeed work as\n> expected.\n>\n> Thanks,\n\nThanks for spotting a bug.  It claims to be subdirectory safe at\nthe top of the script but apparently it isn't.\n\nAnd I do not see a reason why it cannot be made subdirectory\nsafe.\n"},{"id":"54204","messageId":"7vwsubsuh1.fsf@gitster.siamese.dyndns.org","threadId":"10051","inReplyTo":"7v8x6ru97z.fsf@gitster.siamese.dyndns.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-27T20:51:06Z","receivedAt":"2007-09-27T20:51:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Kelvie Wong\" <kelvie@ieee.org> writes:\n>\n>> Egads, it's alive!\n>>\n>> I was in a subdirectory (most of my work is in that one subdirectory\n>> anyways :p), but running it on the top level did indeed work as\n>> expected.\n>>\n>> Thanks,\n>\n> Thanks for spotting a bug.  It claims to be subdirectory safe at\n> the top of the script but apparently it isn't.\n>\n> And I do not see a reason why it cannot be made subdirectory\n> safe.\n\nIt _could_ be just the matter of doing this, although I cannot\ntest it right now (at work and have no access to any of the\nbackends).  Care to try it from a subdirectory and report\nfailure or success?\n\n---\n\n git-mergetool.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex a0e44f7..018db58 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n . git-sh-setup\n require_work_tree\n+cd_to_toplevel\n \n # Returns true if the mode reflects a symlink\n is_symlink () {\n"},{"id":"54205","messageId":"94ccbe710709271417h6349c807j6424c25175c26ea2@mail.gmail.com","threadId":"10051","inReplyTo":"7vwsubsuh1.fsf@gitster.siamese.dyndns.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-27T21:17:16Z","receivedAt":"2007-09-27T21:17:16Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"On 9/27/07, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n> > \"Kelvie Wong\" <kelvie@ieee.org> writes:\n> >\n> >> Egads, it's alive!\n> >>\n> >> I was in a subdirectory (most of my work is in that one subdirectory\n> >> anyways :p), but running it on the top level did indeed work as\n> >> expected.\n> >>\n> >> Thanks,\n> >\n> > Thanks for spotting a bug.  It claims to be subdirectory safe at\n> > the top of the script but apparently it isn't.\n> >\n> > And I do not see a reason why it cannot be made subdirectory\n> > safe.\n>\n> It _could_ be just the matter of doing this, although I cannot\n> test it right now (at work and have no access to any of the\n> backends).  Care to try it from a subdirectory and report\n> failure or success?\n>\n> ---\n>\n>  git-mergetool.sh |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index a0e44f7..018db58 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'\n>  SUBDIRECTORY_OK=Yes\n>  . git-sh-setup\n>  require_work_tree\n> +cd_to_toplevel\n>\n>  # Returns true if the mode reflects a symlink\n>  is_symlink () {\n>\n\nAt least with emerge, this isn't so simple -- emacs tries to save it\nas ${absolute_PWD}/${PWD_relative_to_toplevel}/$filename\n(which of course doesn't exist yet).\n\nIn meld it works fine, however; haven't tried the other ones.\n-- \nKelvie\n"},{"id":"54206","messageId":"94ccbe710709271422x5d1739c2g5da961c88a4336fe@mail.gmail.com","threadId":"10051","inReplyTo":"94ccbe710709271417h6349c807j6424c25175c26ea2@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-27T21:22:41Z","receivedAt":"2007-09-27T21:22:41Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"On 9/27/07, Kelvie Wong <kelvie@ieee.org> wrote:\n> On 9/27/07, Junio C Hamano <gitster@pobox.com> wrote:\n> > Junio C Hamano <gitster@pobox.com> writes:\n> >\n> > > \"Kelvie Wong\" <kelvie@ieee.org> writes:\n> > >\n> > >> Egads, it's alive!\n> > >>\n> > >> I was in a subdirectory (most of my work is in that one subdirectory\n> > >> anyways :p), but running it on the top level did indeed work as\n> > >> expected.\n> > >>\n> > >> Thanks,\n> > >\n> > > Thanks for spotting a bug.  It claims to be subdirectory safe at\n> > > the top of the script but apparently it isn't.\n> > >\n> > > And I do not see a reason why it cannot be made subdirectory\n> > > safe.\n> >\n> > It _could_ be just the matter of doing this, although I cannot\n> > test it right now (at work and have no access to any of the\n> > backends).  Care to try it from a subdirectory and report\n> > failure or success?\n> >\n> > ---\n> >\n> >  git-mergetool.sh |    1 +\n> >  1 files changed, 1 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/git-mergetool.sh b/git-mergetool.sh\n> > index a0e44f7..018db58 100755\n> > --- a/git-mergetool.sh\n> > +++ b/git-mergetool.sh\n> > @@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'\n> >  SUBDIRECTORY_OK=Yes\n> >  . git-sh-setup\n> >  require_work_tree\n> > +cd_to_toplevel\n> >\n> >  # Returns true if the mode reflects a symlink\n> >  is_symlink () {\n> >\n>\n> At least with emerge, this isn't so simple -- emacs tries to save it\n> as ${absolute_PWD}/${PWD_relative_to_toplevel}/$filename\n> (which of course doesn't exist yet).\n>\n> In meld it works fine, however; haven't tried the other ones.\n> --\n> Kelvie\n>\n\nHrm, on closer inspection, the old version of the mergetool script did this too.\n\nIt looks like the bug I mentioned does get fixed by that, and this is\na bug in emacs (or the way it's called).\n-- \nKelvie\n"},{"id":"54207","messageId":"7vmyv7sshv.fsf@gitster.siamese.dyndns.org","threadId":"10051","inReplyTo":"94ccbe710709271422x5d1739c2g5da961c88a4336fe@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-27T21:33:48Z","receivedAt":"2007-09-27T21:33:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kelvie Wong\" <kelvie@ieee.org> writes:\n\n>> > It _could_ be just the matter of doing this, although I cannot\n>> > test it right now (at work and have no access to any of the\n>> > backends).  Care to try it from a subdirectory and report\n>> > failure or success?\n\nActually, it seems that mergetool can take paths arguments, and\nthey need to be adjusted, so here is a fixed patch.\n\n---\n git-mergetool.sh |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex a0e44f7..56ec993 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -12,6 +12,8 @@ USAGE='[--tool=tool] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n . git-sh-setup\n require_work_tree\n+directory_prefix=$(git rev-parse --show-prefix)\n+cd_to_toplevel\n \n # Returns true if the mode reflects a symlink\n is_symlink () {\n@@ -378,7 +380,7 @@ if test $# -eq 0 ; then\n else\n \twhile test $# -gt 0; do\n \t\tprintf \"\\n\"\n-\t\tmerge_file \"$1\"\n+\t\tmerge_file \"$directory_prefix$1\"\n \t\tshift\n \tdone\n fi\n"},{"id":"54208","messageId":"7vir5vss58.fsf@gitster.siamese.dyndns.org","threadId":"10051","inReplyTo":"7vmyv7sshv.fsf@gitster.siamese.dyndns.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-27T21:41:23Z","receivedAt":"2007-09-27T21:41:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When mergetool is run from a subdirectory, \"ls-files -u\" nicely\nlimits the output to conflicted files in that directory, but\nwe need to give the full path to cat-file plumbing to grab the\ncontents of stages.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * I earlier sent one with cd_to_toplevel but I think the\n   approach in this patch is nicer.\n\n git-mergetool.sh |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex a0e44f7..3b1ec13 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n . git-sh-setup\n require_work_tree\n+prefix=$(git rev-parse --show-prefix)\n \n # Returns true if the mode reflects a symlink\n is_symlink () {\n@@ -162,9 +163,9 @@ merge_file () {\n     local_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==2) print $1;}'`\n     remote_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==3) print $1;}'`\n \n-    base_present   && git cat-file blob \":1:$path\" > \"$BASE\" 2>/dev/null\n-    local_present  && git cat-file blob \":2:$path\" > \"$LOCAL\" 2>/dev/null\n-    remote_present && git cat-file blob \":3:$path\" > \"$REMOTE\" 2>/dev/null\n+    base_present   && git cat-file blob \":1:$prefix$path\" >\"$BASE\" 2>/dev/null\n+    local_present  && git cat-file blob \":2:$prefix$path\" >\"$LOCAL\" 2>/dev/null\n+    remote_present && git cat-file blob \":3:$prefix$path\" >\"$REMOTE\" 2>/dev/null\n \n     if test -z \"$local_mode\" -o -z \"$remote_mode\"; then\n \techo \"Deleted merge conflict for '$path':\"\n"},{"id":"54213","messageId":"20070927222326.GB8688@thunk.org","threadId":"10051","inReplyTo":"20070927191125.GD12427@artemis.corp","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-09-27T22:23:26Z","receivedAt":"2007-09-27T22:23:26Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Thu, Sep 27, 2007 at 09:11:25PM +0200, Pierre Habouzit wrote:\n> > >   And as none of the other merge tool that are supported are able to\n> > > either do 3way merges, or have a decent UI (that definitely seems to be\n> > > exclusive features) I've given up on git-mergetool (and to be fair, it\n> > > sucks, because it could be _sooo_ useful sometimes).\n> > > \n> > \n> > What about meld? That does 3-way merge, and the UI is fine.\n> \n>   Indeed, it seems that since the last time I tested it, it now does\n> diff3 merging. I should reevaluate it :)\n\nPierre,\n\nFYI, kdiff3, meld, xxdiff, opendiff (on MacOSX), and emerge all\nsupport 3-way merge.\n\n\t\t\t\t\t\t- Ted\n"},{"id":"54214","messageId":"94ccbe710709271523s7e4c7a1dh53e34bd460c31d1f@mail.gmail.com","threadId":"10051","inReplyTo":"7vir5vss58.fsf@gitster.siamese.dyndns.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-27T22:23:44Z","receivedAt":"2007-09-27T22:23:44Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"On 9/27/07, Junio C Hamano <gitster@pobox.com> wrote:\n> When mergetool is run from a subdirectory, \"ls-files -u\" nicely\n> limits the output to conflicted files in that directory, but\n> we need to give the full path to cat-file plumbing to grab the\n> contents of stages.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>\n>  * I earlier sent one with cd_to_toplevel but I think the\n>    approach in this patch is nicer.\n>\n>  git-mergetool.sh |    7 ++++---\n>  1 files changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index a0e44f7..3b1ec13 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'\n>  SUBDIRECTORY_OK=Yes\n>  . git-sh-setup\n>  require_work_tree\n> +prefix=$(git rev-parse --show-prefix)\n>\n>  # Returns true if the mode reflects a symlink\n>  is_symlink () {\n> @@ -162,9 +163,9 @@ merge_file () {\n>      local_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==2) print $1;}'`\n>      remote_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==3) print $1;}'`\n>\n> -    base_present   && git cat-file blob \":1:$path\" > \"$BASE\" 2>/dev/null\n> -    local_present  && git cat-file blob \":2:$path\" > \"$LOCAL\" 2>/dev/null\n> -    remote_present && git cat-file blob \":3:$path\" > \"$REMOTE\" 2>/dev/null\n> +    base_present   && git cat-file blob \":1:$prefix$path\" >\"$BASE\" 2>/dev/null\n> +    local_present  && git cat-file blob \":2:$prefix$path\" >\"$LOCAL\" 2>/dev/null\n> +    remote_present && git cat-file blob \":3:$prefix$path\" >\"$REMOTE\" 2>/dev/null\n>\n>      if test -z \"$local_mode\" -o -z \"$remote_mode\"; then\n>         echo \"Deleted merge conflict for '$path':\"\n>\n\n--- a/git-mergetool       2007-09-24 09:08:23.000000000 -0700\n+++ b/git-mergetool        2007-09-27 15:04:15.000000000 -0700\n@@ -12,6 +12,7 @@\n SUBDIRECTORY_OK=Yes\n . git-sh-setup\n require_work_tree\n+prefix=$(git rev-parse --show-prefix)\n\n # Returns true if the mode reflects a symlink\n is_symlink () {\n@@ -162,9 +163,9 @@\n     local_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==2) print $1;}'`\n     remote_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==3) print $1;}'`\n\n-    base_present   && git cat-file blob \":1:$path\" > \"$BASE\" 2>/dev/null\n-    local_present  && git cat-file blob \":2:$path\" > \"$LOCAL\" 2>/dev/null\n-    remote_present && git cat-file blob \":3:$path\" > \"$REMOTE\" 2>/dev/null\n+    base_present   && git cat-file blob \":1:$prefix$path\" > \"$BASE\" 2>/dev/null\n+    local_present  && git cat-file blob \":2:$prefix$path\" > \"$LOCAL\"\n2>/dev/null\n+    remote_present && git cat-file blob \":3:$prefix$path\" > \"$REMOTE\"\n2>/dev/null\n\n     if test -z \"$local_mode\" -o -z \"$remote_mode\"; then\n        echo \"Deleted merge conflict for '$path':\"\n@@ -251,7 +252,7 @@\n            ;;\n        emerge)\n            if base_present ; then\n-               emacs -f emerge-files-with-ancestor-command \"$LOCAL\"\n\"$REMOTE\" \"$BASE\" \"$path\"\n+               emacs -f emerge-files-with-ancestor-command \"$LOCAL\"\n\"$REMOTE\" \"$BASE\" \"$(basename \"$path\")\"\n            else\n                emacs -f emerge-files-command \"$LOCAL\" \"$REMOTE\"\n\"$(basename \"$path\")\"\n            fi\n\n\n\nFinally got it to work.  emacs (at least the version I'm using,\n22.1.1) seems to set the $PWD via its first argument, that is,\n$LOCAL's directory, and when it goes to save, it tries to save $path\non top of that.\n\nThe updated patch above would be just to use the basename, that is, if\nit is certain that $LOCAL and $path will always reside in the same\ndirectory -- and I believe, but am not certain, that this is the case.\n\nAlso, I am not sure if this is specific to my version of Emacs, so\nperhaps some further testing is required.\n\n-- \nKelvie\n"},{"id":"54215","messageId":"20070927222825.GG12427@artemis.corp","threadId":"10051","inReplyTo":"20070927222326.GB8688@thunk.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2007-09-27T22:28:25Z","receivedAt":"2007-09-27T22:28:25Z","isPatch":false,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, Sep 27, 2007 at 10:23:26PM +0000, Theodore Tso wrote:\n> On Thu, Sep 27, 2007 at 09:11:25PM +0200, Pierre Habouzit wrote:\n> > > >   And as none of the other merge tool that are supported are able to\n> > > > either do 3way merges, or have a decent UI (that definitely seems to be\n> > > > exclusive features) I've given up on git-mergetool (and to be fair, it\n> > > > sucks, because it could be _sooo_ useful sometimes).\n> > > > \n> > > \n> > > What about meld? That does 3-way merge, and the UI is fine.\n> > \n> >   Indeed, it seems that since the last time I tested it, it now does\n> > diff3 merging. I should reevaluate it :)\n> \n> Pierre,\n> \n> FYI, kdiff3, meld, xxdiff, opendiff (on MacOSX), and emerge all\n> support 3-way merge.\n\n  I know, but:\n  * kdiff3 often take decisions behind your back, and results in broken\n    merges, so it's a no-go ;\n  * xxdiff has (IMHO) a very bad and non-intuitive UI, I never get to\n    make it work ;\n  * I don't use macos (opendiff) ;\n  * emerge is emacs right ? :)\n\n  Though I gave meld another chance, and it works really better than it\nused to, so I may give it a try :) Let's hope I won't be disappointed by\nmeld :)\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"54216","messageId":"20070927223550.GC8688@thunk.org","threadId":"10051","inReplyTo":"7vir5vss58.fsf@gitster.siamese.dyndns.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-09-27T22:35:50Z","receivedAt":"2007-09-27T22:35:50Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Thu, Sep 27, 2007 at 02:41:23PM -0700, Junio C Hamano wrote:\n> When mergetool is run from a subdirectory, \"ls-files -u\" nicely\n> limits the output to conflicted files in that directory, but\n> we need to give the full path to cat-file plumbing to grab the\n> contents of stages.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nAcked-by: \"Theodore Ts'o\" <tytso@mit.edu>\n\n\t\t\t\t\t\t- Ted\n"},{"id":"54217","messageId":"20070927225218.GD8688@thunk.org","threadId":"10051","inReplyTo":"94ccbe710709271523s7e4c7a1dh53e34bd460c31d1f@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-09-27T22:52:18Z","receivedAt":"2007-09-27T22:52:18Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Thu, Sep 27, 2007 at 03:23:44PM -0700, Kelvie Wong wrote:\n> Finally got it to work.  emacs (at least the version I'm using,\n> 22.1.1) seems to set the $PWD via its first argument, that is,\n> $LOCAL's directory, and when it goes to save, it tries to save $path\n> on top of that.\n\nIt's not that emacs sets $PWD via its first argument, but the output\nfile is passed from emerge-files*-command to stashed in the per-buffer\nvariable emerge-file-out, which in turn gets passed to the emacs lisp\nfile write-file, which is what gets run when you run C-x C-w --- and\nwrite-file interprets a relative pathname based on the containing\ndirectory of the existing buffer.\n\n> The updated patch above would be just to use the basename, that is, if\n> it is certain that $LOCAL and $path will always reside in the same\n> directory -- and I believe, but am not certain, that this is the case.\n\n> Also, I am not sure if this is specific to my version of Emacs, so\n> perhaps some further testing is required.\n\nYep, I've checked both emacs21 and emacs23-snapshot, and they both use\nwrite-file, so this seems to be a long-standing bug (and I would call\nit that) in emerge.el.  So a patch like what you suggested is probably\ngoing to be needed.\n\n\t\t\t\t\t\t- Ted\n"},{"id":"54227","messageId":"94ccbe710709272117s6dee1a8jad6edf71dfb13c81@mail.gmail.com","threadId":"10051","inReplyTo":"20070927225218.GD8688@thunk.org","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2007-09-28T04:17:26Z","receivedAt":"2007-09-28T04:17:26Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"On 9/27/07, Theodore Tso <tytso@mit.edu> wrote:\n\n> It's not that emacs sets $PWD via its first argument, but the output\n> file is passed from emerge-files*-command to stashed in the per-buffer\n> variable emerge-file-out, which in turn gets passed to the emacs lisp\n> file write-file, which is what gets run when you run C-x C-w --- and\n> write-file interprets a relative pathname based on the containing\n> directory of the existing buffer.\n>                                                 - Ted\n>\n\nAh yes, I just started reading up on elisp a little while ago :)\n\nI'd always assumed that emacs kept an internal \"pwd\" variable (i.e.\nwhat's displayed with M-x pwd), but I guess my way of thinking is\narchaic and deprecated :(\n\n-- \nKelvie\n"},{"id":"54236","messageId":"20070928051503.GA19815@xp.machine.xx","threadId":"10051","inReplyTo":"20070927222825.GG12427@artemis.corp","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-09-28T05:15:03Z","receivedAt":"2007-09-28T05:15:03Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Fri, Sep 28, 2007 at 12:28:25AM +0200, Pierre Habouzit wrote:\n> On Thu, Sep 27, 2007 at 10:23:26PM +0000, Theodore Tso wrote:\n> > On Thu, Sep 27, 2007 at 09:11:25PM +0200, Pierre Habouzit wrote:\n> > > > >   And as none of the other merge tool that are supported are able to\n> > > > > either do 3way merges, or have a decent UI (that definitely seems to be\n> > > > > exclusive features) I've given up on git-mergetool (and to be fair, it\n> > > > > sucks, because it could be _sooo_ useful sometimes).\n> > > > > \n> > > > \n> > > > What about meld? That does 3-way merge, and the UI is fine.\n> > > \n> > >   Indeed, it seems that since the last time I tested it, it now does\n> > > diff3 merging. I should reevaluate it :)\n> > \n> > Pierre,\n> > \n> > FYI, kdiff3, meld, xxdiff, opendiff (on MacOSX), and emerge all\n> > support 3-way merge.\n> \n>   I know, but:\n>   * kdiff3 often take decisions behind your back, and results in broken\n>     merges, so it's a no-go ;\n>   * xxdiff has (IMHO) a very bad and non-intuitive UI, I never get to\n>     make it work ;\n>   * I don't use macos (opendiff) ;\n>   * emerge is emacs right ? :)\n> \n>   Though I gave meld another chance, and it works really better than it\n> used to, so I may give it a try :) Let's hope I won't be disappointed by\n> meld :)\n> \n\nFWIW, xxdiff has support to handle halfway merged files, so that if git\ncould merge some hunks already for you (e.g. rerere kicked in), you\ndon't have to redo the _whole_ merge by hand, just call\n\n\txxdiff -U file/with/mergemarkers/inside\n\nand it will do the right thing. Not sure if the other tools could handle\nit, but any pointers appreciated, because it often happens to me that\nonly one hunk out of several wasn't merged automatically by git. And\nmergetool wants to always redo the whole merge, which isn't the best it\ncan do.\n\n-Peter\n"},{"id":"54239","messageId":"85tzpfb9c1.fsf@lola.goethe.zz","threadId":"10051","inReplyTo":"94ccbe710709272117s6dee1a8jad6edf71dfb13c81@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-09-28T06:19:42Z","receivedAt":"2007-09-28T06:19:42Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"\"Kelvie Wong\" <kelvie@ieee.org> writes:\n\n> On 9/27/07, Theodore Tso <tytso@mit.edu> wrote:\n>\n>> It's not that emacs sets $PWD via its first argument, but the output\n>> file is passed from emerge-files*-command to stashed in the per-buffer\n>> variable emerge-file-out, which in turn gets passed to the emacs lisp\n>> file write-file, which is what gets run when you run C-x C-w --- and\n>> write-file interprets a relative pathname based on the containing\n>> directory of the existing buffer.\n>>                                                 - Ted\n>>\n>\n> Ah yes, I just started reading up on elisp a little while ago :)\n>\n> I'd always assumed that emacs kept an internal \"pwd\" variable (i.e.\n> what's displayed with M-x pwd), but I guess my way of thinking is\n> archaic and deprecated :(\n\nIt does.  For every buffer.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"54241","messageId":"20070928063546.GA19299@artemis.corp","threadId":"10051","inReplyTo":"20070928051503.GA19815@xp.machine.xx","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2007-09-28T06:35:46Z","receivedAt":"2007-09-28T06:35:46Z","isPatch":false,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, Sep 28, 2007 at 05:15:03AM +0000, Peter Baumann wrote:\n> FWIW, xxdiff has support to handle halfway merged files, so that if git\n> could merge some hunks already for you (e.g. rerere kicked in), you\n> don't have to redo the _whole_ merge by hand, just call\n> \n> \txxdiff -U file/with/mergemarkers/inside\n> \n> and it will do the right thing. Not sure if the other tools could handle\n> it, but any pointers appreciated, because it often happens to me that\n> only one hunk out of several wasn't merged automatically by git. And\n> mergetool wants to always redo the whole merge, which isn't the best it\n> can do.\n\n  For what I've seen, it's how meld works, and I find it nice too. Meld\nis quite slow (python + gnomeish doesn't help) but well, I don't merge\nthings that often, so like said I think I'll give it a try for a while\nand see if it has what it takes :)\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"54246","messageId":"87ejgjrxhi.fsf@morpheus.local","threadId":"10051","inReplyTo":"94ccbe710709271224rc65b6f4k8b68419629ed5b45@mail.gmail.com","subject":"Re: Mergetool generating blank files (1.5.3)","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-09-28T08:43:37Z","receivedAt":"2007-09-28T08:43:37Z","isPatch":false,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\"Kelvie Wong\" <kelvie@ieee.org> writes:\n\n> I've tried all of the ones that were supported, the result is the same\n> -- blank files in all three windows.\n>\n> It is because git mergetool fails to generate these files for whatever\n> reason (the filebasename.{REMOTE,LOCAL,BASE}.* files).  I don't know\n> why this happens.\n>\n> As for merge utilities, all I need is something that looks for the\n> first <<<<<, and lets me choose which version I want (either top or\n> bottom), plain and simple :/  I don't even need/want a gui.\n\nSince you are already using Emacs, let me suggest you use smerge\n(together with ediff).\n\nUse M-x smerge-mode and go over the conflicts and select which one you\nwant with C-c ^ m (for \"mine\") or C-c ^ o (for \"other\") or one of the\ncommands.  Or press C-c ^ E to run a three-window merge.\n\nOr use the last directly by running M-x smerge-ediff.\n\n-- \nDavid Kågedal\n"}]}