git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Pratyush Yadav <me@yadavpratyush.com>
Cc: git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: Why does git diff-index show intent-to-add file as "Added"?
Date: Tue, 27 Oct 2020 13:06:33 -0700	[thread overview]
Message-ID: <xmqqsg9zbfhy.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20201027120943.skmx6c3crbtu335o@yadavpratyush.com> (Pratyush Yadav's message of "Tue, 27 Oct 2020 17:39:43 +0530")

Pratyush Yadav <me@yadavpratyush.com> writes:

> It is `git diff-index --cached HEAD`.
>  
>> What should happen in "diff-index --cached HEAD", I offhand do not
>> know.  "diff-index --cached HEAD" is a request to compare two trees,
>> i.e. the tree that _would_ be produced if you wrote the index out as
>> a tree (i.e. "git write-tree") right now, and the tree of HEAD.  So
>> I think it may be sensible for the command to behave as if the i-t-a
>> path does not even exist in the index when it is run with "--cached";
>> I may be missing some subtleties that require us to do something
>> different, but that is what I would think.
>
> This is what I think too. Can we then treat this as a bug, and work on 
> fixing it? Does any subsystem expert have any comments and/or provide 
> extra context?

I do not think Phillip considers himself an expert in this area, but
what he pointed out in the thread

    http://lore.kernel.org/git/xmqqo8kz70xv.fsf@gitster.c.googlers.com/

is worth listening to.

      reply	other threads:[~2020-10-27 20:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17 16:21 Why does git diff-index show intent-to-add file as "Added"? Pratyush Yadav
2020-10-17 20:18 ` Junio C Hamano
2020-10-18 16:00   ` Phillip Wood
2020-10-18 20:07     ` Junio C Hamano
2020-10-27 12:09   ` Pratyush Yadav
2020-10-27 20:06     ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqsg9zbfhy.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=me@yadavpratyush.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).