git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] builtin/diff: fix incorrect comment
Date: Mon, 15 Jun 2020 07:15:07 -0400	[thread overview]
Message-ID: <a9aea5dbb821544eea636bc5de9fe8185bb603fb.1592219700.git.liu.denton@gmail.com> (raw)

A comment in cmd_diff() states that if one tree-ish and no blobs are
provided, it would provide a diff between the tree and the cache. This
is incorrect because a diff happens between the tree-ish and the working
tree. Remove the `--cached` in the comment so that the correct behavior
is shown.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 builtin/diff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/diff.c b/builtin/diff.c
index 8537b17bd5..1ebab58c55 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -276,7 +276,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 	 *	compare a blob with a working tree file.
 	 *
 	 * N=1, M=0:
-	 *      tree vs cache (diff-index --cached)
+	 *      tree vs files (diff-index)
 	 *
 	 * N=2, M=0:
 	 *      tree vs tree (diff-tree)
-- 
2.27.0.132.g321788e831


             reply	other threads:[~2020-06-15 11:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 11:15 Denton Liu [this message]
2020-06-17 18:07 ` [PATCH] builtin/diff: fix incorrect comment Junio C Hamano
2020-06-18 10:43 ` [PATCH v2] builtin/diff: update usage comment Denton Liu

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=a9aea5dbb821544eea636bc5de9fe8185bb603fb.1592219700.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.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.
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).