git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Raymond E. Pasco" <ray@ameretat.dev>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: <git@vger.kernel.org>, "Phillip Wood" <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2] git-apply.txt: update descriptions of --cached, --index
Date: Thu, 20 Aug 2020 20:26:38 -0400	[thread overview]
Message-ID: <C528Y3DXYRMW.22FBYW4FHMALJ@ziyou.local> (raw)
In-Reply-To: <xmqq4kowc1ls.fsf@gitster.c.googlers.com>

On Thu Aug 20, 2020 at 7:57 PM EDT, Junio C Hamano wrote:
> I do not see why we want to stress the last part after ", even if".
> The safety mechanism insists on the working tree file and the index
> entry to be identical, and the location where in the file the
> difference is, is irrelevant, whether it is outside the area the
> incoming patch touches, or it overlaps.

It's because this is the confusing part of the option - it's easy to
grasp "apply the patch to both the working copy and the index", but
that's not exactly what the option does, it applies only in the case of
identical preimages (and therefore, identical postimages). If you do
want to apply it to both the working copy and the index, which aren't
identical (e.g., you're a heavy worktree mangler and "add -p" user, like
me), this points you towards invoking it twice, once with no option and
once with "--cached".

  reply	other threads:[~2020-08-21  0:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 23:10 [PATCH v2] git-apply.txt: update descriptions of --cached, --index Raymond E. Pasco
2020-08-20 23:57 ` Junio C Hamano
2020-08-21  0:26   ` Raymond E. Pasco [this message]
2020-08-21 16:17     ` Junio C Hamano

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=C528Y3DXYRMW.22FBYW4FHMALJ@ziyou.local \
    --to=ray@ameretat.dev \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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).