From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] Rename confusing variable in show-diff
Date: Sat, 16 Apr 2005 18:10:29 -0700 [thread overview]
Message-ID: <7vzmvy2ooq.fsf@assigned-by-dhcp.cox.net> (raw)
The show-diff command uses a variable "new" but it is always
used to point at the original data recorded in the dircache
before the user started editing in the working file. Rename it
to "old" to avoid confusion.
To be applied on top of my previous patches:
[PATCH] Optionally tell show-diff to show only named files.
[PATCH] show-diff -z option for machine readable output.
[PATCH] show-diff shell safety.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
show-diff.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
show-diff.c: e52eee21c2f682bef2dba06445699cca8e34c63a
--- show-diff.c
+++ show-diff.c 2005-04-16 18:05:55.000000000 -0700
@@ -162,7 +162,7 @@
int changed;
unsigned long size;
char type[20];
- void *new;
+ void *old;
if (1 <argc &&
! matches_pathspec(ce, argv+1, argc-1))
@@ -193,8 +193,8 @@
if (silent)
continue;
- new = read_sha1_file(ce->sha1, type, &size);
- show_differences(ce->name, new, size);
+ old = read_sha1_file(ce->sha1, type, &size);
+ show_differences(ce->name, old, size);
free(new);
}
return 0;
next reply other threads:[~2005-04-17 1:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-17 1:10 Junio C Hamano [this message]
2005-04-17 1:26 ` [PATCH] (take 2) Rename confusing variable in show-diff 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=7vzmvy2ooq.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.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