{"thread":{"id":"18636","subject":"Re: [POC PATCH] diff options: Introduce --interactive","startedAt":"2009-03-30T09:04:39Z","lastAt":"2009-03-30T09:38:52Z","messageCount":2,"participants":["David Aguilar","Ping Yin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"109860","messageId":"20090330090438.GA18953@gmail.com","threadId":"18636","inReplyTo":"1238391670-4421-1-git-send-email-pkufranky@gmail.com","subject":"Re: [POC PATCH] diff options: Introduce --interactive","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-03-30T09:04:39Z","receivedAt":"2009-03-30T09:04:39Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On  0, Ping Yin <pkufranky@gmail.com> wrote:\n> The new option --interactive introduces an interactive diff mode. Now we\n> can choose to see the diff for a selected file.\n\nI just tried it out.  Very cool.\nIt's exactly the functionality users have asked me about.\n\nI just sent a for-the-future patch that teaches difftool\nto tell difftool-helper that it shouldn't prompt when\nyou're using --interactive.\n\nI noticed git-diff doesn't have a -i flag yet,\nperhaps it could be the shorthand for --interactive?\n\n(I'd have to change that for-the-future patch I just sent\n too since it also only checks for the long form...)\n\nI like it.\n\n> \n> This is a preparation to introduce the --tool option to launch the\n> external diff tool for a selected file.\n\nWith both of our latest patches:\n\n\tgit difftool --interactive <revargs>\n\ndoes exactly what one would expect it to.\n\n\nHow are you envisioning --tool?  It'd be great if we didn't\nneed the perl wrapper, though something does need to set\nGIT_EXTERNAL_DIFF/GIT_PAGER/etc... (that is, unless you have a\nbetter way =))\n\n\n> >> When the user types a number,  git-difftool-helper is launched to show\n> >> the diff for the corresponding file.\n> >\n> > Cool.\n> > I had two patches that I sent to the list for\n> > git-difftool.perl.  If you're going to patch it then you might\n> > want to base it on top of those.\n> >\n> When i try to code on git-difftool.perl, i find it is more appropriate to add\n> the --interactive and then --tool options to git-diff itself. So here is a\n> proof of concept patch based on next. What we should do next is to try to\n> design a good UI.\n\nI'll see if I can come up with any suggestions.\nI liked it on the first test drive.\n\n\n-- \n\n\tDavid\n"},{"id":"109870","messageId":"46dff0320903300238s425c4c35nc501b403b0bc3c87@mail.gmail.com","threadId":"18636","inReplyTo":"20090330090438.GA18953@gmail.com","subject":"Re: [POC PATCH] diff options: Introduce --interactive","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2009-03-30T09:38:52Z","receivedAt":"2009-03-30T09:38:52Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Mon, Mar 30, 2009 at 5:04 PM, David Aguilar <davvid@gmail.com> wrote:\n> On  0, Ping Yin <pkufranky@gmail.com> wrote:\n>> The new option --interactive introduces an interactive diff mode. Now we\n>> can choose to see the diff for a selected file.\n>\n> I just tried it out.  Very cool.\n> It's exactly the functionality users have asked me about.\n>\n> I just sent a for-the-future patch that teaches difftool\n> to tell difftool-helper that it shouldn't prompt when\n> you're using --interactive.\n>\n> I noticed git-diff doesn't have a -i flag yet,\n> perhaps it could be the shorthand for --interactive?\n>\n> (I'd have to change that for-the-future patch I just sent\n>  too since it also only checks for the long form...)\n>\n> I like it.\n>\n>>\n>> This is a preparation to introduce the --tool option to launch the\n>> external diff tool for a selected file.\n>\n> With both of our latest patches:\n>\n>        git difftool --interactive <revargs>\n>\n> does exactly what one would expect it to.\n>\n>\n> How are you envisioning --tool?  It'd be great if we didn't\n> need the perl wrapper, though something does need to set\n> GIT_EXTERNAL_DIFF/GIT_PAGER/etc... (that is, unless you have a\n> better way =))\n\nThese environment vars can be set in diff.c directly, by passing the\ngit-difftool. So i think the difftool wrapper can be just removed once\nthe --tool option is available\n\n>\n>\n>> >> When the user types a number,  git-difftool-helper is launched to show\n>> >> the diff for the corresponding file.\n>> >\n>> > Cool.\n>> > I had two patches that I sent to the list for\n>> > git-difftool.perl.  If you're going to patch it then you might\n>> > want to base it on top of those.\n>> >\n>> When i try to code on git-difftool.perl, i find it is more appropriate to add\n>> the --interactive and then --tool options to git-diff itself. So here is a\n>> proof of concept patch based on next. What we should do next is to try to\n>> design a good UI.\n>\n> I'll see if I can come up with any suggestions.\n> I liked it on the first test drive.\n>\n\nHere is the UI i am envisioning, although i am not a good ui designer\n\n1. interactive diff\n\n$ git diff --interactive\n1: M -10/+20   a.c\n2: R -5 /+0    a1.c => a2.c\n3: C -5 /+0    b1.c => b2.c\n\n[p] What now [<n>,t<n>?,p<n>,t,p,q,?]?\n\nWhen hitting '?'\n<n>  - see diff of file <n> in default mode\np<n> - see diff of file <n> in patch mode\nt<n> - see diff of file <n> in tool mode\np    - change to patch diff mode\nt    - change to tool diff mode\nq    - quit this ineraction\n?    - print help\n\nWhen hitting 't'\n[t] What now [<n>,t<n>?,p<n>,t,p,q,?]?\n\n2. interactive diff with --tool\nif using \"git diff --interactive --tool\", then the default diff mode is tool\n\n$ git diff --interactive --tool\n1: M -10/+20   a.c\n2: R -5 /+0    a1.c => a2.c\n3: C -5 /+0    b1.c => b2.c\n\n[t] What now [<n>,t<n>?,p<n>,t,p,q,?]?\n\n3. other considerations\n - --tool can imply --interactive\n - --interactive can imply -p\n - pager is disabled in interactive mode\n"}]}