{"thread":{"id":"7294","subject":"[wishlist] graphical diff","startedAt":"2007-03-18T13:16:24Z","lastAt":"2007-03-19T20:29:06Z","messageCount":11,"participants":["Raimund Bauer","Robin Rosenberg","Christian MICHON","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"37372","messageId":"1174223784.5987.6.camel@localhost","threadId":"7294","inReplyTo":null,"subject":"[wishlist] graphical diff","fromName":"Raimund Bauer","fromEmail":"ray007@gmx.net","sentAt":"2007-03-18T13:16:24Z","receivedAt":"2007-03-18T13:16:24Z","isPatch":false,"sender":{"key":"ray007@gmx.net","avatar":null},"body":"I think it would be really helpful (especially for newbies like me) to\nhave an option like\n\ngit diff --gui [revisions] <singe path spec>\n\nto fire up a graphical diff viewer (similar to what git-mergetool does).\n\nAnother good place to start a graphical diff from is probably gitk from\na context-menu for the changed files in the lower right pane.\n\nThoughts?\n\n-- \nbest regards\n\n  Ray\n"},{"id":"37377","messageId":"200703181606.20678.robin.rosenberg.lists@dewire.com","threadId":"7294","inReplyTo":"1174223784.5987.6.camel@localhost","subject":"Re: [wishlist] graphical diff","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-03-18T15:06:19Z","receivedAt":"2007-03-18T15:06:19Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"söndag 18 mars 2007 14:16 skrev Raimund Bauer:\n> I think it would be really helpful (especially for newbies like me) to\n> have an option like\n> \n> git diff --gui [revisions] <singe path spec>\n> \n> to fire up a graphical diff viewer (similar to what git-mergetool does).\n> \n> Another good place to start a graphical diff from is probably gitk from\n> a context-menu for the changed files in the lower right pane.\n> \n> Thoughts?\n> \n\nFine, except it is not likely to be my favourite gui. But you don't have to wait,\nyou can get a gui easily today.\n\nPipe the output to another tool. Kompare is such a tool which can take a patch\nand compare it. It does not have to a single file. You can diff  two trees and\ncompare. You'll need at kdesdk version 3.5.5 (or 3.5.6)  or the patch in\nhttp://bugs.kde.org/show_bug.cgi?id=131717 for kompare to display git diffs.\n\ngit diff HEAD^..HEAD | kompare -\n\nAs for other gui's I don't know which ones work easily out of the box. \n\nEclipse will soon have recursive diff mode for git. Seems to work here, so I'll probably submit it soon). \n\n-- robin\n"},{"id":"37404","messageId":"46d6db660703181439g277c2c67t22462d360cec5a7b@mail.gmail.com","threadId":"7294","inReplyTo":"1174223784.5987.6.camel@localhost","subject":"Re: [wishlist] graphical diff","fromName":"Christian MICHON","fromEmail":"christian.michon@gmail.com","sentAt":"2007-03-18T21:39:09Z","receivedAt":"2007-03-18T21:39:09Z","isPatch":false,"sender":{"key":"christian.michon@gmail.com","avatar":"https://gravatar.com/avatar/8a7c327b21187fbcab5c27640a49450eec72e0355dc292501197f27a5a744ec4?d=mp&s=160"},"body":"On 3/18/07, Raimund Bauer <ray007@gmx.net> wrote:\n> I think it would be really helpful (especially for newbies like me) to\n> have an option like\n>\n> git diff --gui [revisions] <singe path spec>\n>\n> to fire up a graphical diff viewer (similar to what git-mergetool does).\n>\n> Another good place to start a graphical diff from is probably gitk from\n> a context-menu for the changed files in the lower right pane.\n>\n> Thoughts?\n>\n\ngvimdiff is pretty cool. Have a look at the archives, I asked\nrecently how to perform this, and a few solutions came out\n(you need a sane shell, and the abilities to create fifos).\n\nI'd use it everyday if a true vim/gvim explorer plugin would\nexist (and it's hard to code!).\n\n-- \nChristian\n"},{"id":"37418","messageId":"Pine.LNX.4.63.0703182342110.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7294","inReplyTo":"200703181606.20678.robin.rosenberg.lists@dewire.com","subject":"Re: [wishlist] graphical diff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-18T23:09:06Z","receivedAt":"2007-03-18T23:09:06Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 18 Mar 2007, Robin Rosenberg wrote:\n\n> söndag 18 mars 2007 14:16 skrev Raimund Bauer:\n> > I think it would be really helpful (especially for newbies like me) to\n> > have an option like\n> > \n> > git diff --gui [revisions] <singe path spec>\n\nAnd how do you set _what_ gui you want? Everybody has her pet diff-viewer \n(mine is less, BTW).\n\n> Fine, except it is not likely to be my favourite gui. But you don't have \n> to wait, you can get a gui easily today.\n>\n> [...] \n> \n> git diff HEAD^..HEAD | kompare -\n\nBTW here, \"kompare -\" does not work as expected. It shows an empty diff. \nAt any rate, have you tried something like \"GIT_PAGER='kompare -' git diff \nHEAD^..HEAD\"?\n\nThis reminds me that I always wanted to be able to set the pager from the \ncommand line, so I can set an alias easily:\n\n-- snipsnap --\n[PATCH] Allow setting the pager from the command line\n\nThe command `git` already allows piping the output into a pager with\n`-p`. Now also allow to set the pager with `-p=<pager-cmd>`.\n\nWith this, it is possible to make an alias of command/pager combos, like\nthis:\n\n\t$ git config alias.showmore '-p=more show'\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/git.txt |    8 +++++---\n git.c                 |    7 ++++++-\n 2 files changed, 11 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 0b1203e..5634b30 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -9,7 +9,7 @@ git - the stupid content tracker\n SYNOPSIS\n --------\n [verse]\n-'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]\n+'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate][=<pager-cmd>]\n \t[-n|--name-rev] [-t|--name-rev-by-tags] [--bare]\n \t[--git-dir=GIT_DIR] [--help] COMMAND [ARGS]\n \n@@ -75,8 +75,10 @@ OPTIONS\n \tenvironment variable. If no path is given 'git' will print\n \tthe current setting and then exit.\n \n--p|--paginate::\n-\tPipe all output into 'less' (or if set, $PAGER).\n+-p|--paginate[=<pager-cmd>]::\n+\tPipe all output into 'less'. You can override this by\n+\t\"=<pager-cmd>\", or setting the environment variables $GIT_PAGER\n+\tor $PAGER (in that order).\n \n -n|--name-rev:\n \tTry naming all SHA1s, and page the result (see\ndiff --git a/git.c b/git.c\nindex fca1dfb..76b126d 100644\n--- a/git.c\n+++ b/git.c\n@@ -4,7 +4,7 @@\n #include \"quote.h\"\n \n const char git_usage_string[] =\n-\t\"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]\";\n+\t\"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate][=pager_cmd] [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]\";\n \n static void prepend_to_path(const char *dir, int len)\n {\n@@ -58,6 +58,11 @@ static int handle_options(const char*** argv, int* argc)\n \t\t\t}\n \t\t} else if (!strcmp(cmd, \"-p\") || !strcmp(cmd, \"--paginate\")) {\n \t\t\tsetup_pager();\n+\t\t} else if (!prefixcmp(cmd, \"-p=\") ||\n+\t\t\t\t!prefixcmp(cmd, \"--paginate=\")) {\n+\t\t\tconst char *equal = strchr(cmd, '=');\n+\t\t\tsetenv(\"GIT_PAGER\", equal + 1, 1);\n+\t\t\tsetup_pager();\n \t\t} else if (!strcmp(cmd, \"-n\") || !strcmp(cmd, \"--name-rev\"))\n \t\t\tsetup_name_rev_pager(0);\n \t\telse if (!strcmp(cmd, \"-t\") ||\n-- \n1.5.0.4.2713.g4ff1\n"},{"id":"37424","messageId":"200703190051.46954.robin.rosenberg.lists@dewire.com","threadId":"7294","inReplyTo":"Pine.LNX.4.63.0703182342110.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [wishlist] graphical diff","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-03-18T23:51:45Z","receivedAt":"2007-03-18T23:51:45Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"måndag 19 mars 2007 00:09 skrev Johannes Schindelin:\n> On Sun, 18 Mar 2007, Robin Rosenberg wrote:\n> > git diff HEAD^..HEAD | kompare -\n> \n> BTW here, \"kompare -\" does not work as expected. It shows an empty diff. \nI think that's what the older kompare did. That why mentioned that you need the\nverson from 3.5.5, or even 3.5.6 for this to work.\n\n> At any rate, have you tried something like \"GIT_PAGER='kompare -' git diff \n> HEAD^..HEAD\"?\nDoesn't work here. Shows empty diff...\n\nbut AH, that's because of the colored-diff settings. I you have color.diff or color.status\nset to true neither version will work. With auto the first one will, but not the second. \n\n-- robin\n"},{"id":"37425","messageId":"Pine.LNX.4.63.0703190107410.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7294","inReplyTo":"200703190051.46954.robin.rosenberg.lists@dewire.com","subject":"Re: [wishlist] graphical diff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-19T00:09:58Z","receivedAt":"2007-03-19T00:09:58Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 19 Mar 2007, Robin Rosenberg wrote:\n\n> måndag 19 mars 2007 00:09 skrev Johannes Schindelin:\n> \n> > At any rate, have you tried something like \"GIT_PAGER='kompare -' git \n> > diff HEAD^..HEAD\"?\n>\n> Doesn't work here. Shows empty diff...\n> \n> but AH, that's because of the colored-diff settings. I you have \n> color.diff or color.status set to true neither version will work.\n\nI wonder why we still have \"color.diff=true\", which is wrong in almost \n_all_ cases (instead it should be auto).\n\n> With auto the first one will, but not the second.\n\nThat is to be expected... Git actually expects the pager to be just that, \na pager. So you have to say\n\n$ GIT_PAGER='kompare -' git diff --no-color HEAD^..HEAD\n\nHth,\nDscho\n"},{"id":"37477","messageId":"001001c769fe$af8f4400$0b0aa8c0@abf.local","threadId":"7294","inReplyTo":"Pine.LNX.4.63.0703182342110.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"RE: [wishlist] graphical diff","fromName":"Raimund Bauer","fromEmail":"ray@softwarelandschaft.com","sentAt":"2007-03-19T08:14:58Z","receivedAt":"2007-03-19T08:14:58Z","isPatch":false,"sender":{"key":"ray@softwarelandschaft.com","avatar":null},"body":"On Monday, March 19, Johannes Schindelin wrote:\n> > söndag 18 mars 2007 14:16 skrev Raimund Bauer:\n> > > I think it would be really helpful (especially for \n> newbies like me) \n> > > to have an option like\n> > > \n> > > git diff --gui [revisions] <singe path spec>\n> \n> And how do you set _what_ gui you want? Everybody has her pet \n> diff-viewer \n> (mine is less, BTW).\n\nMaybe with a git.gui config option (like merge.tool)?\nOr by specifying on the commandline:\n\ngit diff --gui=<my-gui-differ> ...\n\nAnd <my-gui-differ> = xxdiff | kompare | tkdiff | ...\n\n-- \nbest regards\n\n  Ray\n"},{"id":"37492","messageId":"Pine.LNX.4.63.0703191359380.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7294","inReplyTo":"001001c769fe$af8f4400$0b0aa8c0@abf.local","subject":"RE: [wishlist] graphical diff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-19T13:00:32Z","receivedAt":"2007-03-19T13:00:32Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 19 Mar 2007, Raimund Bauer wrote:\n\n> On Monday, March 19, Johannes Schindelin wrote:\n> > > söndag 18 mars 2007 14:16 skrev Raimund Bauer:\n> > > > I think it would be really helpful (especially for \n> > newbies like me) \n> > > > to have an option like\n> > > > \n> > > > git diff --gui [revisions] <singe path spec>\n> > \n> > And how do you set _what_ gui you want? Everybody has her pet \n> > diff-viewer \n> > (mine is less, BTW).\n> \n> Maybe with a git.gui config option (like merge.tool)?\n> Or by specifying on the commandline:\n> \n> git diff --gui=<my-gui-differ> ...\n> \n> And <my-gui-differ> = xxdiff | kompare | tkdiff | ...\n\nHave you actually looked at the patch I sent? It is more logical to say \n\"git -p=<bla> diff ...\" when the option \"-p\" (without \"=\") already exists.\n\nCiao,\nDscho\n"},{"id":"37520","messageId":"1174322644.5639.17.camel@localhost","threadId":"7294","inReplyTo":"Pine.LNX.4.63.0703191359380.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"RE: [wishlist] graphical diff","fromName":"Raimund Bauer","fromEmail":"ray007@gmx.net","sentAt":"2007-03-19T16:44:04Z","receivedAt":"2007-03-19T16:44:04Z","isPatch":false,"sender":{"key":"ray007@gmx.net","avatar":null},"body":"Hi,\n\nOn Mon, 2007-03-19 at 14:00 +0100, Johannes Schindelin wrote:\n> > Maybe with a git.gui config option (like merge.tool)?\n> > Or by specifying on the commandline:\n> > \n> > git diff --gui=<my-gui-differ> ...\n> > \n> > And <my-gui-differ> = xxdiff | kompare | tkdiff | ...\n> \n> Have you actually looked at the patch I sent? It is more logical to say \n> \"git -p=<bla> diff ...\" when the option \"-p\" (without \"=\") already exists.\n\nI have, and I can't see your patch doing what I want.\nSorry if I haven't made myself clear what I want, but I was thinking\nabout a shortcut for something like the following example sequence:\n\n$ git show v1.4.0:git.c > git.c.v1.4.0\n$ git show v1.4.4:git.c > git.c.v1.4.4\n$ tkdiff git.c.v1.4.0 git.c.v1.4.4\n$ rm git.c.v1.4.0 git.c.v1.4.4\n\nReplace tkdiff with the differ of your choice.\n\nAt least for comparing 2 single blobs that behavior should be well\ndefined. For comparing multiple blobs, checking them out in 2 separate\ndirectories and starting the differ with the directories could work, but\nI'm more after the single-file case for now ... and that's also the one\nthat should be easy to start from gitk.\n\nIf there's a way to do that by setting the pager I'll be happy to do\nso ;-)\n\n> Ciao,\n> Dscho\n\n-- \nbest regards\n\n  Ray\n"},{"id":"37521","messageId":"Pine.LNX.4.63.0703191748580.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7294","inReplyTo":"1174322644.5639.17.camel@localhost","subject":"RE: [wishlist] graphical diff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-19T16:49:21Z","receivedAt":"2007-03-19T16:49:21Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 19 Mar 2007, Raimund Bauer wrote:\n\n> $ git show v1.4.0:git.c > git.c.v1.4.0\n> $ git show v1.4.4:git.c > git.c.v1.4.4\n> $ tkdiff git.c.v1.4.0 git.c.v1.4.4\n> $ rm git.c.v1.4.0 git.c.v1.4.4\n\nThis almost looks like a script! Why don't you make it one?\n\nCiao,\nDscho\n"},{"id":"37547","messageId":"1174336146.5639.26.camel@localhost","threadId":"7294","inReplyTo":"Pine.LNX.4.63.0703191748580.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"RE: [wishlist] graphical diff","fromName":"Raimund Bauer","fromEmail":"ray007@gmx.net","sentAt":"2007-03-19T20:29:06Z","receivedAt":"2007-03-19T20:29:06Z","isPatch":false,"sender":{"key":"ray007@gmx.net","avatar":null},"body":"On Mon, 2007-03-19 at 17:49 +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Mon, 19 Mar 2007, Raimund Bauer wrote:\n> \n> > $ git show v1.4.0:git.c > git.c.v1.4.0\n> > $ git show v1.4.4:git.c > git.c.v1.4.4\n> > $ tkdiff git.c.v1.4.0 git.c.v1.4.4\n> > $ rm git.c.v1.4.0 git.c.v1.4.4\n> \n> This almost looks like a script! Why don't you make it one?\n\nBecause I had hoped that someone more familiar with git and scripting\nthan me can come up with something, that\n1.) also works in the multi-file case\n2.) can take all the usual object and revision specifiers that git diff\ntakes.\n\nAnd then there's gitk integration ...\n\nBut I'll take a look at it ;-)\n\n> Ciao,\n> Dscho\n\n-- \nbest regards\n\n  Ray\n"}]}