{"thread":{"id":"36450","subject":"Project idea: github-like diff view","startedAt":"2014-04-20T09:58:28Z","lastAt":"2014-04-22T16:11:46Z","messageCount":5,"participants":["Duy Nguyen","Jeff King","Felipe Contreras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"239145","messageId":"CACsJy8CQxPrqs31nBvr_oPRD3EJ6Hu-Lq=++7nWpxx5BQZYi8Q@mail.gmail.com","threadId":"36450","inReplyTo":null,"subject":"Project idea: github-like diff view","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-04-20T09:58:28Z","receivedAt":"2014-04-20T09:58:28Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"When you view a commit from github, it shows extra info besides\nstandard unified diff format:\n\n- the column number of each line (useful for jumping directly to that\nline without manual counting from @@ line)\n- --color-words within unified diff format, using background color to\nshow what part of the line has changed. This is only enabled for\n1-line changes.\n\nThese can be implemented and seem useful, especially the --color-words\nitem. Once you get familiar with diff.c I suppose you could implement\nboth in a week (the first probably takes just a day).\n-- \nDuy\n"},{"id":"239147","messageId":"20140420144620.GA16596@sigill.intra.peff.net","threadId":"36450","inReplyTo":"CACsJy8CQxPrqs31nBvr_oPRD3EJ6Hu-Lq=++7nWpxx5BQZYi8Q@mail.gmail.com","subject":"Re: Project idea: github-like diff view","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-04-20T14:46:20Z","receivedAt":"2014-04-20T14:46:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Apr 20, 2014 at 04:58:28PM +0700, Duy Nguyen wrote:\n\n> - --color-words within unified diff format, using background color to\n> show what part of the line has changed. This is only enabled for\n> 1-line changes.\n\nSee contrib/diff-highlight.\n\n-Peff\n"},{"id":"239321","messageId":"CACsJy8DnJeZ-43Ydg_j00CO6=6NOA1wdzQ+EwCX6idrUOLn8gA@mail.gmail.com","threadId":"36450","inReplyTo":"20140420144620.GA16596@sigill.intra.peff.net","subject":"Re: Project idea: github-like diff view","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-04-22T09:59:17Z","receivedAt":"2014-04-22T09:59:17Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Apr 20, 2014 at 9:46 PM, Jeff King <peff@peff.net> wrote:\n> On Sun, Apr 20, 2014 at 04:58:28PM +0700, Duy Nguyen wrote:\n>\n>> - --color-words within unified diff format, using background color to\n>> show what part of the line has changed. This is only enabled for\n>> 1-line changes.\n>\n> See contrib/diff-highlight.\n\nThanks. I'd rather have it built in core git still. I'll try to see if\nI can rewrite it in C. Else, any objection to promote it to a core\nhelper and setup pager automatically? We can have a config key to turn\nit off, but if git diff is colored, then it could be on by default.\n-- \nDuy\n"},{"id":"239340","messageId":"20140422155901.GA13663@sigill.intra.peff.net","threadId":"36450","inReplyTo":"CACsJy8DnJeZ-43Ydg_j00CO6=6NOA1wdzQ+EwCX6idrUOLn8gA@mail.gmail.com","subject":"Re: Project idea: github-like diff view","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-04-22T15:59:01Z","receivedAt":"2014-04-22T15:59:01Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 22, 2014 at 04:59:17PM +0700, Duy Nguyen wrote:\n\n> On Sun, Apr 20, 2014 at 9:46 PM, Jeff King <peff@peff.net> wrote:\n> > On Sun, Apr 20, 2014 at 04:58:28PM +0700, Duy Nguyen wrote:\n> >\n> >> - --color-words within unified diff format, using background color to\n> >> show what part of the line has changed. This is only enabled for\n> >> 1-line changes.\n> >\n> > See contrib/diff-highlight.\n> \n> Thanks. I'd rather have it built in core git still. I'll try to see if\n> I can rewrite it in C. Else, any objection to promote it to a core\n> helper and setup pager automatically? We can have a config key to turn\n> it off, but if git diff is colored, then it could be on by default.\n\nIf you are going to write it as part of git, it would be interesting to\ntry using a real word-diff to find the inter-line changes, instead of\nthe \"front and back match\" heuristic that the script uses. I know there\nare some cases that would look better, like:\n\n  -foo(buf, len);\n  +foo(obj->buf, obj->len);\n\nbut I suspect some cases would also look worse. It would be interesting\nto experiment with, though.\n\n-Peff\n"},{"id":"239344","messageId":"535694c23647e_3e5aed730839@nysa.notmuch","threadId":"36450","inReplyTo":"CACsJy8DnJeZ-43Ydg_j00CO6=6NOA1wdzQ+EwCX6idrUOLn8gA@mail.gmail.com","subject":"Re: Project idea: github-like diff view","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-22T16:11:46Z","receivedAt":"2014-04-22T16:11:46Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Duy Nguyen wrote:\n> On Sun, Apr 20, 2014 at 9:46 PM, Jeff King <peff@peff.net> wrote:\n> > On Sun, Apr 20, 2014 at 04:58:28PM +0700, Duy Nguyen wrote:\n> >\n> >> - --color-words within unified diff format, using background color to\n> >> show what part of the line has changed. This is only enabled for\n> >> 1-line changes.\n> >\n> > See contrib/diff-highlight.\n> \n> Thanks. I'd rather have it built in core git still. I'll try to see if\n> I can rewrite it in C. Else, any objection to promote it to a core\n> helper and setup pager automatically? We can have a config key to turn\n> it off, but if git diff is colored, then it could be on by default.\n\nHaving so many tools that should be rewritten to C, I don't see why anybody\nshould spent time rewriting scripts that are not part of the core and for the\nmost part do their job already.\n\n-- \nFelipe Contreras\n"}]}