{"thread":{"id":"9815","subject":"PATCH to add a button to perform a meld on the current file","startedAt":"2007-09-07T04:46:22Z","lastAt":"2007-09-07T11:25:12Z","messageCount":2,"participants":["Pierre Marc Dumuid","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"52850","messageId":"46E0D79E.3080606@adelaide.edu.au","threadId":"9815","inReplyTo":null,"subject":"PATCH to add a button to perform a meld on the current file","fromName":"Pierre Marc Dumuid","fromEmail":"pierre.dumuid@adelaide.edu.au","sentAt":"2007-09-07T04:46:22Z","receivedAt":"2007-09-07T04:46:22Z","isPatch":false,"sender":{"key":"pierre.dumuid@adelaide.edu.au","avatar":null},"body":"Here's a dodgy [not that good] patch to perform a GUI comparison on a file.\nIt is dodgy because it assumes cogito is installed, and you want to use \nmeld, and it doesn't remove the temporary files.\n\nNot expecting this to go into main branch, but I find it handy for my \nown purposes nether-the-less.\n\nPierre\n\n\n--- /usr/bin/gitk\t2007-08-06 07:55:41.000000000 +0930\n+++ /home/pmdumuid/bin/gitkpmd\t2007-09-07 14:09:28.000000000 +0930\n@@ -609,7 +609,9 @@\n \t-command changediffdisp -variable diffelide -value {0 1}\n     radiobutton .bleft.mid.new -text \"New version\" \\\n \t-command changediffdisp -variable diffelide -value {1 0}\n-    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left\n+    button .bleft.top.meld -text \"GUI diff\" -command doguidiff \\\n+\t-font $uifont\n+    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new .bleft.top.meld -side left\n     set ctext .bleft.ctext\n     text $ctext -background $bgcolor -foreground $fgcolor \\\n \t-state disabled -font $textfont \\\n@@ -4564,6 +4566,19 @@\n     }\n }\n \n+proc doguidiff {} {\n+    global cflist sha1string\n+\n+    set taglist [$cflist tag ranges highlight]\n+    set from [lindex $taglist 0]\n+    set to [lindex $taglist 1]\n+\n+    set fname [$cflist get $from $to]\n+    exec cg-admin-cat -r $sha1string^ $fname > .gitk_diffolder\n+    exec cg-admin-cat -r $sha1string $fname > .gitk_diffnewer\n+    exec meld .gitk_diffolder .gitk_diffnewer &\n+}\n+\n proc dosearch {} {\n     global sstring ctext searchstring searchdirn\n \n"},{"id":"52897","messageId":"Pine.LNX.4.64.0709071214330.28586@racer.site","threadId":"9815","inReplyTo":"46E0D79E.3080606@adelaide.edu.au","subject":"Re: PATCH to add a button to perform a meld on the current file","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-09-07T11:25:12Z","receivedAt":"2007-09-07T11:25:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 7 Sep 2007, Pierre Marc Dumuid wrote:\n\n> Here's a dodgy [not that good] patch to perform a GUI comparison on a \n> file. It is dodgy because it assumes cogito is installed, and you want \n> to use meld, and it doesn't remove the temporary files.\n\ncogito is phased out.\n\n> Not expecting this to go into main branch, but I find it handy for my \n> own purposes nether-the-less.\n\nJust in case you want to get it in, here are some comments (made harder by \nthe fact that you did not follow Documentation/SubmittingPatches)...\n\n> --- /usr/bin/gitk\t2007-08-06 07:55:41.000000000 +0930\n> +++ /home/pmdumuid/bin/gitkpmd\t2007-09-07 14:09:28.000000000 +0930\n\nYou might want to consider using format-patch next time ;-)\n\n> @@ -4564,6 +4566,19 @@\n>      }\n>  }\n>  \n> +proc doguidiff {} {\n> +    global cflist sha1string\n> +\n> +    set taglist [$cflist tag ranges highlight]\n> +    set from [lindex $taglist 0]\n> +    set to [lindex $taglist 1]\n> +\n> +    set fname [$cflist get $from $to]\n> +    exec cg-admin-cat -r $sha1string^ $fname > .gitk_diffolder\n> +    exec cg-admin-cat -r $sha1string $fname > .gitk_diffnewer\n\nThis can be be achieved by \"git cat-file -t blob $sha1string^:$fname\", and \nlikewise for $sha1string.\n\n+    exec meld .gitk_diffolder .gitk_diffnewer &\n+}\n\nHmm.  If you allow it to block, you might have more chances to clean up \nthe temporary files...\n\nAlso, it would be nice to have it configurable which tool you use, a la \ngit-mergetool.\n\nCiao,\nDscho\n \n"}]}