All of lore.kernel.org
 help / color / mirror / Atom feed
* git-diff-tree --root
@ 2014-09-12 13:06 Roman Neuhauser
  2014-09-12 17:31 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Neuhauser @ 2014-09-12 13:06 UTC (permalink / raw)
  To: git

hello,

git-diff-tree without --root is absolutely silent for the root commit,
and i see no bad effects of --root on non-root commits.  are there any
hidden gotchas?  IOW, why is the --root behavior not the default?

cram[1] testcase::

  $ git init -q scratch
  $ cd scratch
  $ echo '.*.sw?' > .gitignore
  $ git add .gitignore
  $ git commit -q -m init .gitignore

  $ git diff-tree HEAD

  $ git diff-tree --root HEAD
  [0-9a-z]{40} (re)
  :000000 100644 0000000000000000000000000000000000000000 [0-9a-z]{40} A\\t.* (re)

[1] https://pypi.python.org/pypi/cram

-- 
roman

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-diff-tree --root
  2014-09-12 13:06 git-diff-tree --root Roman Neuhauser
@ 2014-09-12 17:31 ` Junio C Hamano
  2014-09-13  8:57   ` Roman Neuhauser
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2014-09-12 17:31 UTC (permalink / raw)
  To: Roman Neuhauser; +Cc: git

Roman Neuhauser <neuhauser@sigpipe.cz> writes:

> git-diff-tree without --root is absolutely silent for the root commit,
> and i see no bad effects of --root on non-root commits.  are there any
> hidden gotchas?  IOW, why is the --root behavior not the default?

Because tools that was written before you proposed that change
expect to see nothing for the root commit, and then you are suddenly
breaking their expectations?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-diff-tree --root
  2014-09-12 17:31 ` Junio C Hamano
@ 2014-09-13  8:57   ` Roman Neuhauser
  2014-09-15 17:04     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Neuhauser @ 2014-09-13  8:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

# gitster@pobox.com / 2014-09-12 10:31:30 -0700:
> Roman Neuhauser <neuhauser@sigpipe.cz> writes:
> > git-diff-tree without --root is absolutely silent for the root commit,
> > and i see no bad effects of --root on non-root commits.  are there any
> > hidden gotchas?  IOW, why is the --root behavior not the default?
> 
> Because tools that was written before you proposed that change
> expect to see nothing for the root commit, and then you are suddenly
> breaking their expectations?

i'm not proposing anything, i'm just curious why it is this way.
my line of thinking: there must be (or have been) a grave reason to
break the simple consistency, or the current behavior must be very
useful for something and i'm just missing what it is.  the reasons
for the behavior may have been invalidated by further developments,
or it may have been a wrong decision we're stuck with for BC; i'm
just curious about history.

motivation for my question is that i'm scripting git-diff-tree
and i need it to produce the diff for root commits as well.  i like
my scripts as simple as possible, so i'd like to use --root *always*.
is it safe?

-- 
roman

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-diff-tree --root
  2014-09-13  8:57   ` Roman Neuhauser
@ 2014-09-15 17:04     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2014-09-15 17:04 UTC (permalink / raw)
  To: Roman Neuhauser; +Cc: git

Roman Neuhauser <neuhauser@sigpipe.cz> writes:

> ... I like
> my scripts as simple as possible, so I'd like to use --root *always*.

With "--root", the command does not do anything different without
for commits that are not root commits, and it shows "everything
created from nothing" for root commits.  The option was invented to
help those who want that behaviour, so if you'd like to use it
always, then you are welcome to do so ;-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-15 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 13:06 git-diff-tree --root Roman Neuhauser
2014-09-12 17:31 ` Junio C Hamano
2014-09-13  8:57   ` Roman Neuhauser
2014-09-15 17:04     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.