git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH] apply: clarify description of --index
Date: Thu, 22 Oct 2020 20:49:09 -0700	[thread overview]
Message-ID: <xmqqzh4dk3ey.fsf@gitster.c.googlers.com> (raw)

Instead of explaining the requirement for the paths to be up-to-date,
as if it is an afterthought, state it upfront.

The updated description matches how the checks actually are
performed.  A path that is "dirty" stops the patch application from
being attempted to either working tree files or to the index.

Hopefully this change would help users to form a better mental
model.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * Just noticed while reviewing how "apply" (and "am") are explained.

 Documentation/git-apply.txt | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index 91d9a8601c..1be7751f58 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -61,13 +61,11 @@ OPTIONS
 	file and detects errors.  Turns off "apply".
 
 --index::
-	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.
 
 --cached::
 	Apply the patch to just the index, without touching the working
-- 
2.28.0-462-gf84ddd074d


             reply	other threads:[~2020-10-23  3:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  3:49 Junio C Hamano [this message]
2020-10-23  5:31 ` [PATCH] apply: clarify description of --index Johannes Sixt
2020-10-23 14:38   ` Junio C Hamano
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

  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=xmqqzh4dk3ey.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.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.
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).