From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] Do not run useless show-diff on unmerged paths repeatedly.
Date: Sat, 16 Apr 2005 19:18:02 -0700 [thread overview]
Message-ID: <7vis2m2lk5.fsf@assigned-by-dhcp.cox.net> (raw)
When run on unmerged dircache, show-diff compares the working
file with each non-empty stage for that path. Two out of three
times, this is not very helpful. This patch makes it report the
unmergedness only once per each path and avoids running the
actual diff.
Upper layer SCMs like Cogito are expected to find out mode/SHA1
for each stage by using "show-files --stage" and run the diff
itself. This would result in more sensible diffs.
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.
[PATCH] (take 2) Rename confusing variable in show-diff.
[PATCH] show-diff style fix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
++show-diff.c | 13 +++++++++++++
1 files changed, 13 insertions(+)
--- ./show-diff.c 2005-04-16 19:01:28.000000000 -0700
+++ ./++show-diff.c 2005-04-16 18:57:55.000000000 -0700
@@ -167,6 +167,19 @@
! matches_pathspec(ce, argv+1, argc-1))
continue;
+ if (ce_stage(ce)) {
+ if (machine_readable)
+ printf("U %s%c", ce->name, 0);
+ else
+ printf("%s: Unmerged\n",
+ ce->name);
+ while (i < entries &&
+ !strcmp(ce->name, active_cache[i]->name))
+ i++;
+ i--; /* compensate for loop control increments */
+ continue;
+ }
+
if (stat(ce->name, &st) < 0) {
if (errno == ENOENT && silent_on_nonexisting_files)
continue;
reply other threads:[~2005-04-17 2:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=7vis2m2lk5.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;
as well as URLs for NNTP newsgroup(s).