From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] apply: clarify description of --index
Date: Fri, 23 Oct 2020 07:38:55 -0700 [thread overview]
Message-ID: <xmqqzh4dhurk.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <23806f2c-df96-b105-3b85-f40b0e8ec7ca@kdbg.org> (Johannes Sixt's message of "Fri, 23 Oct 2020 07:31:16 +0200")
Johannes Sixt <j6t@kdbg.org> writes:
>> - Apply the patch to both the index and the working tree (or
>> - merely check that it would apply cleanly to both if `--check` is
>> - in effect). Note that `--index` expects index entries and
>> - working tree copies for relevant paths to be identical (their
>> - contents and metadata such as file mode must match), and will
>> - raise an error if they are not, even if the patch would apply
>> - cleanly to both the index and the working tree in isolation.
>> + After making sure the paths the patch touches in the working
>> + tree have no modifications relative to their index entries,
>> + apply the patch both to the index entries and to the working
>> + tree files or see if it applies cleanly, when `--check` is in
>> + effect.
>
> I don't think that this is an improvement. The purpose of --index *is*
> to apply the patch to both index and worktree, and that should be
> mentioned first. The check that both are identical, is a prerequisite
> and not the primary objective of the option.
Yeah, but this was an attempt to clarify what that "apply to both",
which is the central part of the operation, exactly means.
The only mode of operation we offer is that we start from identical
index and working tree, and make the same change so that we arrive
at the same outcome. It is not like you can have some changes in
the working tree file as long as they do not overlap and collide
with the incoming patch, make the same change with the patch to
arrive at different contents as the outcome. We explicitly forbid
that, but "apply to both" does not exactly tell it to the readers.
But I am OK to drop this, if you do not think it clarifies the
description.
Thanks.
next prev parent reply other threads:[~2020-10-23 14:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 3:49 [PATCH] apply: clarify description of --index Junio C Hamano
2020-10-23 5:31 ` Johannes Sixt
2020-10-23 14:38 ` Junio C Hamano [this message]
2020-10-23 18:08 ` Johannes Sixt
2020-10-23 20:18 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqzh4dhurk.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
/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 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 NNTP newsgroup(s).