{"thread":{"id":"44530","subject":"v2.11 new diff heuristic?","startedAt":"2016-11-22T14:42:43Z","lastAt":"2016-11-22T17:57:25Z","messageCount":4,"participants":["Robert Dailey","Jacob Keller","Stefan Beller","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"306301","messageId":"CAHd499AjXh1YnVgBj_8j0fgvOgOn53y+sPBBy6y7mSM-+dCyVw@mail.gmail.com","threadId":"44530","inReplyTo":null,"subject":"v2.11 new diff heuristic?","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2016-11-22T14:42:36Z","receivedAt":"2016-11-22T14:42:43Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"The release notes mention a new heuristic for diff:\n\n* Output from \"git diff\" can be made easier to read by selecting\nwhich lines are common and which lines are added/deleted\nintelligently when the lines before and after the changed section\nare the same. A command line option is added to help with the\nexperiment to find a good heuristics.\n\nHowever, it lacks information on exactly how to use this new feature.\nI dug into the git diff documentation here:\n\nhttps://git-scm.com/docs/git-diff\n\nIt mentions a \"--compaction-heuristic\" option. Is this the new\nheuristic outlined by the release notes? If not, which is it? Is the\ncompaction heuristic compatible with the histogram diff algorithm? Is\nthere a config option to turn this on all the time? For that matter,\nis this something I can keep on all the time or is it only useful in\ncertain situations?\n\nThere's still so much more about this feature I would like to know.\n"},{"id":"306315","messageId":"502984B2-1ADF-4BEC-9C5D-057AADAA7C61@gmail.com","threadId":"44530","inReplyTo":"CAHd499AjXh1YnVgBj_8j0fgvOgOn53y+sPBBy6y7mSM-+dCyVw@mail.gmail.com","subject":"Re: v2.11 new diff heuristic?","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-11-22T17:18:05Z","receivedAt":"2016-11-22T17:18:20Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On November 22, 2016 6:42:36 AM PST, Robert Dailey <rcdailey.lists@gmail.com> wrote:\n>The release notes mention a new heuristic for diff:\n>\n>* Output from \"git diff\" can be made easier to read by selecting\n>which lines are common and which lines are added/deleted\n>intelligently when the lines before and after the changed section\n>are the same. A command line option is added to help with the\n>experiment to find a good heuristics.\n>\n>However, it lacks information on exactly how to use this new feature.\n>I dug into the git diff documentation here:\n>\n>https://git-scm.com/docs/git-diff\n>\n>It mentions a \"--compaction-heuristic\" option. Is this the new\n>heuristic outlined by the release notes? If not, which is it? Is the\n>compaction heuristic compatible with the histogram diff algorithm? Is\n>there a config option to turn this on all the time? For that matter,\n>is this something I can keep on all the time or is it only useful in\n>certain situations?\n>\n>There's still so much more about this feature I would like to know.\n\nHi,\n\nYes for now the compaction heuristic option has an undocumented config. (I forget the exact name off the top of my head). Currently it is being evaluated and likely we want to make it default in the near future once we are certain that it helps and doesn't make any difference worse.\n\nSo long term you will not need any special knobs to benefit.\n\nThanks,\nJake\n\n"},{"id":"306320","messageId":"CAGZ79kbJ1vM=wd+53RezKEuucBCG96rL7dNhZpqR6m+brRAJ=w@mail.gmail.com","threadId":"44530","inReplyTo":"CAHd499AjXh1YnVgBj_8j0fgvOgOn53y+sPBBy6y7mSM-+dCyVw@mail.gmail.com","subject":"Re: v2.11 new diff heuristic?","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-11-22T17:51:35Z","receivedAt":"2016-11-22T17:52:30Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Nov 22, 2016 at 6:42 AM, Robert Dailey <rcdailey.lists@gmail.com> wrote:\n> The release notes mention a new heuristic for diff:\n>\n> * Output from \"git diff\" can be made easier to read by selecting\n> which lines are common and which lines are added/deleted\n> intelligently when the lines before and after the changed section\n> are the same. A command line option is added to help with the\n> experiment to find a good heuristics.\n>\n> However, it lacks information on exactly how to use this new feature.\n> I dug into the git diff documentation here:\n>\n> https://git-scm.com/docs/git-diff\n>\n> It mentions a \"--compaction-heuristic\" option. Is this the new\n> heuristic outlined by the release notes?\n\nyes.\n\n> Is the\n> compaction heuristic compatible with the histogram diff algorithm?\n\nyes as the compaction heuristic is applied after the actual diff is performed.\n\n> Is\n> there a config option to turn this on all the time? For that matter,\n> is this something I can keep on all the time or is it only useful in\n> certain situations?\n\nI think you can set diff.compactionHeuristic and it will use it by default.\n\n>\n> There's still so much more about this feature I would like to know.\n\nThe background story (and what this new compaction heuristic is doing)\nis found at https://github.com/mhagger/diff-slider-tools\n"},{"id":"306323","messageId":"20161122175550.mlxzt3kgw3hj52qh@sigill.intra.peff.net","threadId":"44530","inReplyTo":"CAHd499AjXh1YnVgBj_8j0fgvOgOn53y+sPBBy6y7mSM-+dCyVw@mail.gmail.com","subject":"Re: v2.11 new diff heuristic?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-11-22T17:55:51Z","receivedAt":"2016-11-22T17:57:25Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 22, 2016 at 08:42:36AM -0600, Robert Dailey wrote:\n\n> I dug into the git diff documentation here:\n> \n> https://git-scm.com/docs/git-diff\n> \n> It mentions a \"--compaction-heuristic\" option. Is this the new\n> heuristic outlined by the release notes? If not, which is it?\n\nNo. The docs on git-scm.com are only for released versions, so that is\nthe \"old\" attempt at a similar feature from v2.9. The \"new\" one goes by\nthe name \"--indent-heuristic\" (and \"diff.indentHeuristic\" in the\nconfig). It is not the default in v2.11, but it probably will become so\nin a future version.\n\n> Is the\n> compaction heuristic compatible with the histogram diff algorithm? Is\n> there a config option to turn this on all the time? For that matter,\n> is this something I can keep on all the time or is it only useful in\n> certain situations?\n> \n> There's still so much more about this feature I would like to know.\n\nYes, you can keep it all the time. Yes, it's compatible with histogram\n(and patience); it happens as a separate post-processing step after the\nactual diff.\n\nYou can find more discussion about how it works in the commit message of\n433860f3d0beb0c6f205290bd16cda413148f098.\n\n-Peff\n"}]}