{"thread":{"id":"500","subject":"Version of dirdiff to display diffs between git trees","startedAt":"2005-05-06T13:18:30Z","lastAt":"2005-05-07T00:01:18Z","messageCount":5,"participants":["Paul Mackerras","Linus Torvalds","Krzysztof Halasa"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"2665","messageId":"17019.28326.351036.268948@cargo.ozlabs.ibm.com","threadId":"500","inReplyTo":null,"subject":"Version of dirdiff to display diffs between git trees","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2005-05-06T13:18:30Z","receivedAt":"2005-05-06T13:18:30Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"I have adapted my \"dirdiff\" program to be able to display differences\nbetween git trees (without checking them out).  It can display the\ndifferences between up to 5 trees, each of which can be either a git\ntree (identified by a tree id, a commit id or a tag) or the working\ndirectory.\n\nThe main window summarizes which files have changed.  Double-clicking\non a file name pops up a diff viewer window which displays the\ndifferences between the different versions of the file in a\ncolor-coded unidiff format.  I find it useful to copy .git/HEAD to\n.git/OLD_HEAD before doing an update on my linux-2.6 repository, and\nthen after the update do\n\n\tgirdiff OLD_HEAD HEAD\n\nto see what has changed.  With the file list I can easily skip over\nfiles that I'm not interested in and then use the diff viewer to look\nat changes to files that I do care about.\n\nI have called this version \"girdiff\" to distinguish it from my normal\ndirdiff releases.  It is available at:\n\n\thttp://ozlabs.org/~paulus/girdiff\n\nIf invoked as girdiff, or if invoked as dirdiff and the -g flag is\ngiven, it will interpret its arguments as git trees rather than\ndirectory or file names.  As a special case, the working directory is\nindicated by \".\".\n\nThis is still under development and there are probably bugs - let me\nknow if you find any.\n\nPaul.\n\n\n\n"},{"id":"2673","messageId":"Pine.LNX.4.58.0505060916320.2233@ppc970.osdl.org","threadId":"500","inReplyTo":"17019.28326.351036.268948@cargo.ozlabs.ibm.com","subject":"Re: Version of dirdiff to display diffs between git trees","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-06T16:19:02Z","receivedAt":"2005-05-06T16:19:02Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 6 May 2005, Paul Mackerras wrote:\n> The main window summarizes which files have changed.  Double-clicking\n> on a file name pops up a diff viewer window which displays the\n> differences between the different versions of the file in a\n> color-coded unidiff format.  I find it useful to copy .git/HEAD to\n> .git/OLD_HEAD before doing an update on my linux-2.6 repository, and\n> then after the update do\n\nIf you use git-pull-script, it does this for you (except it calls it\nORIG_HEAD), and you can just do\n\n\tgit-diff-tree -p ORIG_HEAD HEAD\n\nto see the changes. In fact git-pull-script will do that for you, and \noutput the diffstat of it.\n\nHaving the original head is also nice for when you decide that the other \nside has had a few too many drugs, in which case you just do\n\n\tcat .git/ORIG_HEAD > .git/HEAD\n\tgit-read-tree -m HEAD\n\tgit-checkout-cache -f -a\n\tgit-update-cache --refresh\n\nand you're back to your original head (the above is basically \"unpull\").\n\n\t\tLinus\n"},{"id":"2692","messageId":"m3d5s4jieh.fsf@defiant.localdomain","threadId":"500","inReplyTo":"Pine.LNX.4.58.0505060916320.2233@ppc970.osdl.org","subject":"Re: Version of dirdiff to display diffs between git trees","fromName":"Krzysztof Halasa","fromEmail":"khc@pm.waw.pl","sentAt":"2005-05-06T18:53:10Z","receivedAt":"2005-05-06T18:53:10Z","isPatch":false,"sender":{"key":"khc@pm.waw.pl","avatar":null},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> \tcat .git/ORIG_HEAD > .git/HEAD\n> \tgit-read-tree -m HEAD\n> \tgit-checkout-cache -f -a\n> \tgit-update-cache --refresh\n>\n> and you're back to your original head (the above is basically \"unpull\").\n\nSo, is \"git-read-tree -m HEAD\" actually equivalent to \"git-read-tree HEAD\"\nand does it simply write complete index (ignoring the old one)\ncorresponding to given HEAD?\n-- \nKrzysztof Halasa\n"},{"id":"2696","messageId":"Pine.LNX.4.58.0505061200060.2233@ppc970.osdl.org","threadId":"500","inReplyTo":"m3d5s4jieh.fsf@defiant.localdomain","subject":"Re: Version of dirdiff to display diffs between git trees","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-06T19:07:29Z","receivedAt":"2005-05-06T19:07:29Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 6 May 2005, Krzysztof Halasa wrote:\n>\n> Linus Torvalds <torvalds@osdl.org> writes:\n> \n> > \tcat .git/ORIG_HEAD > .git/HEAD\n> > \tgit-read-tree -m HEAD\n> > \tgit-checkout-cache -f -a\n> > \tgit-update-cache --refresh\n> >\n> > and you're back to your original head (the above is basically \"unpull\").\n> \n> So, is \"git-read-tree -m HEAD\" actually equivalent to \"git-read-tree HEAD\"\n> and does it simply write complete index (ignoring the old one)\n> corresponding to given HEAD?\n\nYes, \"git-read-tree -m HEAD\" is 100% equivalent to the version without\n\"-m\" except: that it reads the old index file, and picks up the file stat\ninformation from there if the name/SHA1 pair matches.\n\nThis has two implications:\n\n - \"git-read-tree -m HEAD\" is a lot better than the non \"-m\" version, \n   since it means that if most of the files are unchanged between the new\n   and the old tree, _most_ of the index is still up-to-date.\n\n   You still need to do \"git-update-cache --refresh\" to make sure the \n   index is fully up-to-date, but now the refresh has to do a _lot_ less.\n\n - If your old index file has crap in it, it won't work. If you have a \n   corrupt index file, you can't use \"-m\". And in particular, if the merge \n   _failed_ and you have unmerged entries in your index file, you can't\n   use \"-m\" (I might change that, and let the single-merge case just \n   ignore unmerged entries).\n\nSo the rule is: normally you probably want to use \"-m\", but if you want to\nstart from a totally clean slate because something went wrong, you should\nskip the \"-m\" which then does the \"reset the whole index\" without the\nmerge of the old index information.\n\n(Also, if the new tree you're reading is totally different from the old \none, or you don't have anything checked out, you're better off without the \n\"-m\", since it will just add overhead for no gain).\n\n\t\t\tLinus\n"},{"id":"2724","messageId":"17020.1358.415173.230113@cargo.ozlabs.ibm.com","threadId":"500","inReplyTo":"Pine.LNX.4.58.0505060916320.2233@ppc970.osdl.org","subject":"Re: Version of dirdiff to display diffs between git trees","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2005-05-07T00:01:18Z","receivedAt":"2005-05-07T00:01:18Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Linus Torvalds writes:\n\n> If you use git-pull-script, it does this for you (except it calls it\n\nOK, cool\n\n> ORIG_HEAD), and you can just do\n> \n> \tgit-diff-tree -p ORIG_HEAD HEAD\n> \n> to see the changes. In fact git-pull-script will do that for you, and \n> output the diffstat of it.\n\nYes, girdiff with two trees is mostly equivalent to git-diff-tree,\nexcept that I find the girdiff/dirdiff display much easier to nagivate\nand parse than a patch viewed in an xterm with less.  (I say \"mostly\nequivalent\" because if neither tree is the ancestor of the other,\ngirdiff looks at the common ancestor to get an idea of which tree has\nthe more recent version of each file that differs, and colors that one\ngreen and the other red, which is extra information that git-diff-tree\ndoesn't give you.)\n\nSimilarly, girdiff with a tree and \".\" is equivalent to\ngit-diff-cache.\n\nGirdiff also has the new dirdiff features of being able to expand the\ndisplayed context for a hunk, to move changed lines up and down within\na hunk (provided the movement doesn't change the meaning of the diff),\nand to split context lines into identical -/+ lines (which, together\nwith being able to move -/+ lines makes it possible to rearrange a\ndiff to make it more understandable).\n\nIf the working directory is one of the trees being diffed, you can\nselect parts of the diff for a file to be applied to the working\ndirectory file.  (You can't apply changes to a git tree, of course,\nbecause it's immutable.)  You can also select parts of the diff for a\nfile and generate a patch embodying just the selected changes.\n\nNext I want to do a commit viewer with the ability to display the\ndifferences between arbitrary points in the commit tree using girdiff.\n\nPaul.\n"}]}