All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: git@vger.kernel.org
Subject: Re: Can't diff against the 00000000 revision
Date: Tue, 12 Jan 2016 10:52:41 -0800	[thread overview]
Message-ID: <xmqqpox6tyti.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <jwvr3hmwz1n.fsf-monnier+gmane.comp.version-control.git@gnu.org> (Stefan Monnier's message of "Tue, 12 Jan 2016 11:26:24 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> And hopefully that explains why "000000" does not necessarily make a
>> good placeholder for "the empty thing". There are multiple empty things,
>> and it is not clear what:
>
>>   git diff 0000000 1234abcd
>
>> means. Is 0000000 a tree? A blob?
>
> Well, Git is the one who uses 000000 to refer to an empty thing, but
> indeed it seems like it does inconsistently: it's sometimes used as the
> "empty blob" and sometimes as an "empty tree".

Git does not use 0*40 to refer to "an empty thing" at all.  It is
used to denote a "missing thing".  A change to _create_ a new file
and a diff to _modify_ an existing empty file are conceptually two
different things, and are shown differently.

It would be incorrect to say "it used to be an empty blob" by using
e69de29bb2d1d on the left hand side of a patch that creates a new
file.

  parent reply	other threads:[~2016-01-12 18:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 15:17 Can't diff against the 00000000 revision Stefan Monnier
2016-01-12 15:32 ` Jeff King
2016-01-12 15:37   ` Jeff King
2016-01-12 16:26   ` Stefan Monnier
2016-01-12 18:20     ` Jeff King
2016-01-12 18:52     ` Junio C Hamano [this message]
2016-01-12 18:11   ` Andreas Schwab
2016-01-12 18:21     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqpox6tyti.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.