{"thread":{"id":"37543","subject":"git-diff-tree --root","startedAt":"2014-09-12T13:06:07Z","lastAt":"2014-09-15T17:04:10Z","messageCount":4,"participants":["Roman Neuhauser","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"249302","messageId":"20140912130607.GX4075@isis.sigpipe.cz","threadId":"37543","inReplyTo":null,"subject":"git-diff-tree --root","fromName":"Roman Neuhauser","fromEmail":"neuhauser@sigpipe.cz","sentAt":"2014-09-12T13:06:07Z","receivedAt":"2014-09-12T13:06:07Z","isPatch":false,"sender":{"key":"neuhauser@sigpipe.cz","avatar":null},"body":"hello,\n\ngit-diff-tree without --root is absolutely silent for the root commit,\nand i see no bad effects of --root on non-root commits.  are there any\nhidden gotchas?  IOW, why is the --root behavior not the default?\n\ncram[1] testcase::\n\n  $ git init -q scratch\n  $ cd scratch\n  $ echo '.*.sw?' > .gitignore\n  $ git add .gitignore\n  $ git commit -q -m init .gitignore\n\n  $ git diff-tree HEAD\n\n  $ git diff-tree --root HEAD\n  [0-9a-z]{40} (re)\n  :000000 100644 0000000000000000000000000000000000000000 [0-9a-z]{40} A\\\\t.* (re)\n\n[1] https://pypi.python.org/pypi/cram\n\n-- \nroman\n"},{"id":"249312","messageId":"xmqq61gsbv9p.fsf@gitster.dls.corp.google.com","threadId":"37543","inReplyTo":"20140912130607.GX4075@isis.sigpipe.cz","subject":"Re: git-diff-tree --root","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-12T17:31:30Z","receivedAt":"2014-09-12T17:31:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Roman Neuhauser <neuhauser@sigpipe.cz> writes:\n\n> git-diff-tree without --root is absolutely silent for the root commit,\n> and i see no bad effects of --root on non-root commits.  are there any\n> hidden gotchas?  IOW, why is the --root behavior not the default?\n\nBecause tools that was written before you proposed that change\nexpect to see nothing for the root commit, and then you are suddenly\nbreaking their expectations?\n"},{"id":"249338","messageId":"20140913085735.GA4075@isis.sigpipe.cz","threadId":"37543","inReplyTo":"xmqq61gsbv9p.fsf@gitster.dls.corp.google.com","subject":"Re: git-diff-tree --root","fromName":"Roman Neuhauser","fromEmail":"neuhauser@sigpipe.cz","sentAt":"2014-09-13T08:57:35Z","receivedAt":"2014-09-13T08:57:35Z","isPatch":false,"sender":{"key":"neuhauser@sigpipe.cz","avatar":null},"body":"# gitster@pobox.com / 2014-09-12 10:31:30 -0700:\n> Roman Neuhauser <neuhauser@sigpipe.cz> writes:\n> > git-diff-tree without --root is absolutely silent for the root commit,\n> > and i see no bad effects of --root on non-root commits.  are there any\n> > hidden gotchas?  IOW, why is the --root behavior not the default?\n> \n> Because tools that was written before you proposed that change\n> expect to see nothing for the root commit, and then you are suddenly\n> breaking their expectations?\n\ni'm not proposing anything, i'm just curious why it is this way.\nmy line of thinking: there must be (or have been) a grave reason to\nbreak the simple consistency, or the current behavior must be very\nuseful for something and i'm just missing what it is.  the reasons\nfor the behavior may have been invalidated by further developments,\nor it may have been a wrong decision we're stuck with for BC; i'm\njust curious about history.\n\nmotivation for my question is that i'm scripting git-diff-tree\nand i need it to produce the diff for root commits as well.  i like\nmy scripts as simple as possible, so i'd like to use --root *always*.\nis it safe?\n\n-- \nroman\n"},{"id":"249434","messageId":"xmqqr3zc95o5.fsf@gitster.dls.corp.google.com","threadId":"37543","inReplyTo":"20140913085735.GA4075@isis.sigpipe.cz","subject":"Re: git-diff-tree --root","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-15T17:04:10Z","receivedAt":"2014-09-15T17:04:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Roman Neuhauser <neuhauser@sigpipe.cz> writes:\n\n> ... I like\n> my scripts as simple as possible, so I'd like to use --root *always*.\n\nWith \"--root\", the command does not do anything different without\nfor commits that are not root commits, and it shows \"everything\ncreated from nothing\" for root commits.  The option was invented to\nhelp those who want that behaviour, so if you'd like to use it\nalways, then you are welcome to do so ;-)\n"}]}