{"id":1539,"date":"2011-05-09T13:28:17","date_gmt":"2011-05-09T13:28:17","guid":{"rendered":"http:\/\/math.columbia.edu\/~dejong\/wordpress\/?p=1539"},"modified":"2012-07-14T00:27:15","modified_gmt":"2012-07-14T00:27:15","slug":"patience-diff","status":"publish","type":"post","link":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/?p=1539","title":{"rendered":"Patience diff"},"content":{"rendered":"<p>It turns out that moving a bunch of text inside one of the tex files is a very bad case for git&#8217;s diff algorithm. But if you use the patience diff using a switch then it works fine. For example<br \/>\n<code><br \/>\n$ git --no-pager log --oneline --stat -n1 a081d8a<br \/>\na081d8a Moved sections<br \/>\n more-morphisms.tex |11761 ++++++++++++++++++++++++++--------------------------<br \/>\n 1 files changed, 5879 insertions(+), 5882 deletions(-)<br \/>\n<\/code><br \/>\nand with patience diff I get<br \/>\n<code><br \/>\n$ git --no-pager log --oneline --stat --patience -n1 a081d8a<br \/>\na081d8a Moved sections<br \/>\n more-morphisms.tex | 1717 ++++++++++++++++++++++++++--------------------------<br \/>\n 1 files changed, 857 insertions(+), 860 deletions(-)<br \/>\n<\/code><br \/>\nI use &#8220;git diff&#8221; to quickly review what I&#8217;ve changed since the last commit. I was annoyed that moving a section or a lemma caused what is clearly the wrong output. Now I know how to avoid it.<\/p>\n<p>The (entirely uninteresting) diff for the commit mentioned above can be found <a href=\"https:\/\/github.com\/stacks\/stacks-project\/commit\/a081d8ad4faf2e381b5c0d0028e2234cad8c5dff\">here<\/a>. This link in particular shows that github doesn&#8217;t use patience diff!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It turns out that moving a bunch of text inside one of the tex files is a very bad case for git&#8217;s diff algorithm. But if you use the patience diff using a switch then it works fine. For example &hellip; <a href=\"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/?p=1539\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1539","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1539"}],"version-history":[{"count":13,"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1539\/revisions"}],"predecessor-version":[{"id":2627,"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1539\/revisions\/2627"}],"wp:attachment":[{"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.math.columbia.edu\/~dejong\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}