git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Re: [PATCH] git-diff: Introduce --index and deprecate --cached.
@ 2022-06-15  7:58 Ali Almrhbi
  0 siblings, 0 replies; 8+ messages in thread
From: Ali Almrhbi @ 2022-06-15  7:58 UTC (permalink / raw)
  To: nnn2271989; +Cc: ae, git, jakesteward0916, junkio



‫أُرسلت من الـ iPhone‬

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] git-diff: Introduce --index and deprecate --cached.
@ 2023-10-10  3:46 Russell Nelson
  0 siblings, 0 replies; 8+ messages in thread
From: Russell Nelson @ 2023-10-10  3:46 UTC (permalink / raw)
  To: junkio; +Cc: ae, git



Sent from my iPhone

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] git-diff: Introduce --index and deprecate --cached.
@ 2022-12-17 21:48 Bob Swift
  0 siblings, 0 replies; 8+ messages in thread
From: Bob Swift @ 2022-12-17 21:48 UTC (permalink / raw)
  To: junkio; +Cc: ae, git



Abraham Lincoln

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] git-diff: Introduce --index and deprecate --cached.
@ 2021-09-12 21:39 nu ja
  0 siblings, 0 replies; 8+ messages in thread
From: nu ja @ 2021-09-12 21:39 UTC (permalink / raw)
  To: jakesteward0916; +Cc: ae, git, junkio



‫iPhone‬

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] git-diff: Introduce --index and deprecate --cached.
@ 2020-11-10  7:32 Jake Steward
  0 siblings, 0 replies; 8+ messages in thread
From: Jake Steward @ 2020-11-10  7:32 UTC (permalink / raw)
  To: junkio; +Cc: ae, git

[-- Attachment #1: 00b0ac6c22b99900bb49047e2a24bfa35b2fa69c.numbers --]
[-- Type: application/octet-stream, Size: 76661 bytes --]

[-- Attachment #2: Type: text/plain, Size: 21 bytes --]



Sent from my iPhone

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] git-diff: Introduce --index and deprecate --cached.
@ 2006-11-30 11:43 Andreas Ericsson
  2006-12-09  2:24 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Ericsson @ 2006-11-30 11:43 UTC (permalink / raw)
  To: git

'git diff --cached' still works, but its use is discouraged
in the documentation. 'git diff --index' does the same thing
and is consistent with how 'git apply --index' works.

Signed-off-by: Andreas Ericsson <ae@op5.se>
---
 Documentation/git-diff.txt |    6 ++++--
 builtin-diff.c             |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 228c4d9..3144864 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -22,8 +22,10 @@ the number of trees given to the command.
 
 * When one <tree-ish> is given, the working tree and the named
   tree are compared, using `git-diff-index`.  The option
-  `--cached` can be given to compare the index file and
+  `--index` can be given to compare the index file and
   the named tree.
+  `--cached` is a deprecated alias for `--index`. It's use is
+  discouraged.
 
 * When two <tree-ish>s are given, these two trees are compared
   using `git-diff-tree`.
@@ -47,7 +49,7 @@ Various ways to check your working tree::
 +
 ------------
 $ git diff            <1>
-$ git diff --cached   <2>
+$ git diff --index    <2>
 $ git diff HEAD       <3>
 ------------
 +
diff --git a/builtin-diff.c b/builtin-diff.c
index a659020..1c535b1 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -137,7 +137,7 @@ static int builtin_diff_index(struct rev_info *revs,
 	int cached = 0;
 	while (1 < argc) {
 		const char *arg = argv[1];
-		if (!strcmp(arg, "--cached"))
+		if (!strcmp(arg, "--index") || !strcmp(arg, "--cached"))
 			cached = 1;
 		else
 			usage(builtin_diff_usage);
-- 
1.4.4.1.GIT

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

end of thread, other threads:[~2023-10-10  3:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15  7:58 [PATCH] git-diff: Introduce --index and deprecate --cached Ali Almrhbi
  -- strict thread matches above, loose matches on Subject: below --
2023-10-10  3:46 Russell Nelson
2022-12-17 21:48 Bob Swift
2021-09-12 21:39 nu ja
2020-11-10  7:32 Jake Steward
2006-11-30 11:43 Andreas Ericsson
2006-12-09  2:24 ` Junio C Hamano
2006-12-09  2:29   ` Junio C Hamano

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