git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] builtin/diff: fix incorrect comment
@ 2020-06-15 11:15 Denton Liu
  2020-06-17 18:07 ` Junio C Hamano
  2020-06-18 10:43 ` [PATCH v2] builtin/diff: update usage comment Denton Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Denton Liu @ 2020-06-15 11:15 UTC (permalink / raw)
  To: Git Mailing List

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-18 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 11:15 [PATCH] builtin/diff: fix incorrect comment Denton Liu
2020-06-17 18:07 ` Junio C Hamano
2020-06-18 10:43 ` [PATCH v2] builtin/diff: update usage comment Denton Liu

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).