From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/3] Diff overhaul, adding the other half...
Date: Tue, 24 May 2005 02:05:08 -0700 [thread overview]
Message-ID: <7vr7fxuh8b.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0505240129420.2307@ppc970.osdl.org> (Linus Torvalds's message of "Tue, 24 May 2005 01:31:52 -0700 (PDT)")
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> (I think that's just because the "silent" test used to depend on the
LT> magical behaviour of the "header" thing, and now that the header
LT> generation and suppression is sane, "silent" doesn't work any more)
I think you will be more efficient for this task but I'm willing
to volunteer if you let me know how "silent" should behave. The
documentation says it is useful only with -v and supresses the
diffs, so if that is the only thing it does, I think something
like this is sufficient? Not tested enough but I am going to
crash for the day now.
------------
Use DIFF_FORMAT_NO_OUTPUT to implement diff-tree -s option.
Instead of checking silent flag all over the place, simply use
the NO_OUTPUT option diffcore provides to suppress the diff
output.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
jit-diff
# - HEAD: Allow symlinks in the leading path in checkout-cache --prefix=
# + (working tree)
diff --git a/diff-tree.c b/diff-tree.c
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -2,7 +2,6 @@
#include "cache.h"
#include "diff.h"
-static int silent = 0;
static int show_root_diff = 0;
static int verbose_header = 0;
static int ignore_merges = 1;
@@ -67,9 +66,6 @@ static void show_file(const char *prefix
const char *path;
const unsigned char *sha1 = extract(tree, size, &path, &mode);
- if (silent)
- return;
-
if (recursive && S_ISDIR(mode)) {
char type[20];
unsigned long size;
@@ -132,9 +128,6 @@ static int compare_tree_entry(void *tree
return retval;
}
- if (silent)
- return 0;
-
diff_change(mode1, mode2, sha1, sha2, base, path1);
return 0;
}
@@ -395,8 +388,7 @@ static char *generate_header(const char
if (this_header[offset-1] != '\n')
this_header[offset++] = '\n';
/* Add _another_ EOLN if we are doing diff output */
- if (!silent)
- this_header[offset++] = '\n';
+ this_header[offset++] = '\n';
this_header[offset] = 0;
}
@@ -442,8 +434,6 @@ static int diff_tree_commit(const unsign
* Don't print multiple merge entries if we
* don't print the diffs.
*/
- if (silent)
- break;
}
offset += 48;
}
@@ -540,7 +530,7 @@ int main(int argc, const char **argv)
continue;
}
if (!strcmp(arg, "-s")) {
- silent = 1;
+ diff_output_format = DIFF_FORMAT_NO_OUTPUT;
continue;
}
if (!strcmp(arg, "-v")) {
Compilation finished at Tue May 24 02:03:10
next prev parent reply other threads:[~2005-05-24 9:04 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-19 10:32 [PATCH] Detect renames in diff family Junio C Hamano
2005-05-19 16:19 ` Linus Torvalds
2005-05-19 17:13 ` Junio C Hamano
2005-05-19 17:31 ` Linus Torvalds
2005-05-19 18:29 ` Nicolas Pitre
2005-05-19 18:46 ` Junio C Hamano
2005-05-19 18:58 ` Nicolas Pitre
2005-05-19 20:36 ` Junio C Hamano
2005-05-19 20:48 ` Nicolas Pitre
2005-05-19 21:44 ` Junio C Hamano
2005-05-19 22:26 ` Linus Torvalds
2005-05-19 23:32 ` Junio C Hamano
2005-05-20 0:10 ` Linus Torvalds
2005-05-20 0:48 ` Junio C Hamano
2005-05-19 18:47 ` Junio C Hamano
2005-05-19 18:42 ` Junio C Hamano
2005-05-19 18:55 ` Linus Torvalds
2005-05-19 19:53 ` Junio C Hamano
2005-05-19 20:12 ` H. Peter Anvin
2005-05-19 17:46 ` Joel Becker
2005-05-21 9:37 ` Junio C Hamano
2005-05-21 9:39 ` [PATCH 1/3] Diff overhaul, adding half of copy detection Junio C Hamano
2005-05-21 9:40 ` [PATCH 2/3] Introducing software archaeologist's tool "pickaxe" Junio C Hamano
2005-05-21 22:02 ` [PATCH] Constness fix for pickaxe option Junio C Hamano
2005-05-21 22:16 ` Linus Torvalds
2005-05-21 9:42 ` [PATCH 3/3] Diff overhaul, adding the other half of copy detection Junio C Hamano
2005-05-21 10:11 ` [PATCH] Teach diff-tree to report unmodified paths for -C option Junio C Hamano
2005-05-21 10:51 ` Junio C Hamano
2005-05-21 17:25 ` [PATCH 3/3] Diff overhaul, adding the other half of copy detection Linus Torvalds
2005-05-21 18:10 ` [PATCH 3/3] Diff overhaul, adding the other half Junio C Hamano
2005-05-21 18:27 ` Linus Torvalds
2005-05-21 18:34 ` Linus Torvalds
2005-05-21 18:45 ` Linus Torvalds
2005-05-21 20:10 ` Junio C Hamano
2005-05-24 5:37 ` Junio C Hamano
2005-05-24 6:19 ` Linus Torvalds
2005-05-24 8:16 ` Junio C Hamano
2005-05-24 8:31 ` Linus Torvalds
2005-05-24 9:05 ` Junio C Hamano [this message]
2005-05-26 3:17 ` [RFC/PATCH] Detect copies harder in diff-tree Junio C Hamano
2005-05-21 19:54 ` [PATCH 3/3] Diff overhaul, adding the other half Junio C Hamano
2005-05-21 22:55 ` [PATCH] Tweak diffcore-rename heuristics Junio C Hamano
[not found] ` <Pine.LNX.4.58.0505211004400.2206@ppc970.osdl.org>
[not found] ` <7v4qcwihu1.fsf@assigned-by-dhcp.cox.net>
2005-05-23 6:50 ` Now I think I am done with 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=7vr7fxuh8b.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.