{"thread":{"id":"18573","subject":"[RFC] Interactive difftool","startedAt":"2009-03-26T15:29:07Z","lastAt":"2009-03-28T09:14:56Z","messageCount":5,"participants":["Ping Yin","David Aguilar","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"109542","messageId":"46dff0320903260829j34d8c613wf9b4fcc954c8519a@mail.gmail.com","threadId":"18573","inReplyTo":null,"subject":"[RFC] Interactive difftool","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2009-03-26T15:29:07Z","receivedAt":"2009-03-26T15:29:07Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"Before git-difftool goes to master, i want to propose a new feature to\nadd to or replace the current behaviour of difftool. With current\ndifftool, we can only see the diff one by one. However, sometimes what\nwe want is to see the diff of selected files, or in a different order,\njust like what we can do in the gui. So here is what i propose\n\n$ git difftool --interactive [options]\n[1] diff.c                   |   10 +++++++++-\n[2] t/t4020-diff-external.sh |    8 ++++++++\nChoose the file you want to see the diff of: 2\n\nWhen the user types 2 and then <enter>, the external diff program is called\n\nFurther more, instead of just type a number, a letter can be prepended\nto the number to represent different ways of diff. For example\n\nt2 (tool 2): see the diff for file 2 with the configured diff tool\np2 (patch 2): see the diff for file 2 in the patch format\n\nWhat do you think?\n\nPing Yin\n"},{"id":"109652","messageId":"20090327145122.GA944@gmail.com","threadId":"18573","inReplyTo":"46dff0320903260829j34d8c613wf9b4fcc954c8519a@mail.gmail.com","subject":"Re: [RFC] Interactive difftool","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-03-27T14:51:22Z","receivedAt":"2009-03-27T14:51:22Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On  0, Ping Yin <pkufranky@gmail.com> wrote:\n> Before git-difftool goes to master, i want to propose a new feature to\n> add to or replace the current behaviour of difftool. With current\n> difftool, we can only see the diff one by one. However, sometimes what\n> we want is to see the diff of selected files, or in a different order,\n> just like what we can do in the gui. So here is what i propose\n> \n> $ git difftool --interactive [options]\n> [1] diff.c                   |   10 +++++++++-\n> [2] t/t4020-diff-external.sh |    8 ++++++++\n> Choose the file you want to see the diff of: 2\n> \n> When the user types 2 and then <enter>, the external diff program is called\n> \n> Further more, instead of just type a number, a letter can be prepended\n> to the number to represent different ways of diff. For example\n> \n> t2 (tool 2): see the diff for file 2 with the configured diff tool\n> p2 (patch 2): see the diff for file 2 in the patch format\n> \n> What do you think?\n> \n> Ping Yin\n\nThat would be pretty cool.  I don't know about the\nmerge-to-master timing and whether we'd want to include new\nfeatures before the move.\n\nI guess most of the work would have to be done in\ngit-difftool-helper.sh.  I had a co-worker that asked for this\nexact feature just the other day (and ditto for mergetool).\n\nPatches are welcome if you have an idea for how it could work.\nRight now we get called indirectly by git-diff so I\ndon't know if there's an easy way to hook into it like that.\nIt might be a matter of changing git-difftool.perl so that it\ndoes more of the dispatching itself.\n\n-- \n\n\tDavid\n"},{"id":"109656","messageId":"46dff0320903270823v5e8e9c80w506d8a85440588f5@mail.gmail.com","threadId":"18573","inReplyTo":"20090327145122.GA944@gmail.com","subject":"Re: [RFC] Interactive difftool","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2009-03-27T15:23:15Z","receivedAt":"2009-03-27T15:23:15Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Fri, Mar 27, 2009 at 10:51 PM, David Aguilar <davvid@gmail.com> wrote:\n> On  0, Ping Yin <pkufranky@gmail.com> wrote:\n>> Before git-difftool goes to master, i want to propose a new feature to\n>> add to or replace the current behaviour of difftool. With current\n>> difftool, we can only see the diff one by one. However, sometimes what\n>> we want is to see the diff of selected files, or in a different order,\n>> just like what we can do in the gui. So here is what i propose\n>>\n>> $ git difftool --interactive [options]\n>> [1] diff.c                   |   10 +++++++++-\n>> [2] t/t4020-diff-external.sh |    8 ++++++++\n>> Choose the file you want to see the diff of: 2\n>>\n>> When the user types 2 and then <enter>, the external diff program is called\n>>\n>> Further more, instead of just type a number, a letter can be prepended\n>> to the number to represent different ways of diff. For example\n>>\n>> t2 (tool 2): see the diff for file 2 with the configured diff tool\n>> p2 (patch 2): see the diff for file 2 in the patch format\n>>\n>> What do you think?\n>>\n>> Ping Yin\n>\n> That would be pretty cool.  I don't know about the\n> merge-to-master timing and whether we'd want to include new\n> features before the move.\n>\n> I guess most of the work would have to be done in\n> git-difftool-helper.sh.  I had a co-worker that asked for this\n> exact feature just the other day (and ditto for mergetool).\n>\n> Patches are welcome if you have an idea for how it could work.\n> Right now we get called indirectly by git-diff so I\n> don't know if there's an easy way to hook into it like that.\n> It might be a matter of changing git-difftool.perl so that it\n> does more of the dispatching itself.\n>\n\nWe can just change git-difftool.perl\n\nThe easiest way is first parsing the output of git diff --stat,\nadding the number at the beginning, for example\n[1] diff.c                   |   10 +++++++++-\n[2] t/t4020-diff-external.sh |    8 ++++++++\n\nWhen the user types a number,  git-difftool-helper is launched to show\nthe diff for the corresponding file.\n"},{"id":"109691","messageId":"20090328073253.GA9013@coredump.intra.peff.net","threadId":"18573","inReplyTo":"46dff0320903270823v5e8e9c80w506d8a85440588f5@mail.gmail.com","subject":"Re: [RFC] Interactive difftool","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-28T07:32:53Z","receivedAt":"2009-03-28T07:32:53Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 27, 2009 at 11:23:15PM +0800, Ping Yin wrote:\n\n> We can just change git-difftool.perl\n> \n> The easiest way is first parsing the output of git diff --stat,\n> adding the number at the beginning, for example\n> [1] diff.c                   |   10 +++++++++-\n> [2] t/t4020-diff-external.sh |    8 ++++++++\n\nI am not paying enough attention to this thread to comment on your\noverall goal, but instead of parsing \"--stat\", try \"--numstat\".\n\n-Peff\n"},{"id":"109694","messageId":"46dff0320903280214i5cddb261sb439f0330a8ec4e1@mail.gmail.com","threadId":"18573","inReplyTo":"20090328073253.GA9013@coredump.intra.peff.net","subject":"Re: [RFC] Interactive difftool","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2009-03-28T09:14:56Z","receivedAt":"2009-03-28T09:14:56Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Sat, Mar 28, 2009 at 3:32 PM, Jeff King <peff@peff.net> wrote:\n> On Fri, Mar 27, 2009 at 11:23:15PM +0800, Ping Yin wrote:\n>\n>> We can just change git-difftool.perl\n>>\n>> The easiest way is first parsing the output of git diff --stat,\n>> adding the number at the beginning, for example\n>> [1] diff.c                   |   10 +++++++++-\n>> [2] t/t4020-diff-external.sh |    8 ++++++++\n>\n> I am not paying enough attention to this thread to comment on your\n> overall goal, but instead of parsing \"--stat\", try \"--numstat\".\n>\n\nThanks, that helps.\n"}]}