Add --no-commit-id option for git-diff-tree, use it in gitk
This patch introduces -no-commit-id option for git-diff-tree, which suppresses commit ID output. [jc: dropped gitk part for now.] Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Pavel Roskin committed
Nov 10, 2005 at 00:30 UTC
601c978c1bc9f6742c18932cb9d4a6910934f785
2 files changed
+12
-2
Documentation/git-diff-tree.txt
+5
-1
@@ -8,7 +8,7 @@ git-diff-tree - Compares the content and mode of blobs found via two tree object
8
9
SYNOPSIS
10
--------
11
-'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [-r] [--root] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
11
+'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r] [--root] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
12
13
DESCRIPTION
14
-----------
@@ -74,6 +74,10 @@ separated with a single space are given.
74
commit message. Without "=<style>", it defaults to
75
medium.
76
77
+--no-commit-id::
78
+ git-diff-tree outputs a line with the commit ID when
79
+ applicable. This flag suppressed the commit ID output.
80
+
81
82
Limiting Output
83
---------------
diff-tree.c
+7
-1
@@ -3,6 +3,7 @@
3
#include "commit.h"
4
5
static int show_root_diff = 0;
6
+static int no_commit_id = 0;
7
static int verbose_header = 0;
8
static int ignore_merges = 1;
9
static int read_stdin = 0;
@@ -29,7 +30,8 @@ static int call_diff_flush(void)
30
return 0;
31
}
32
if (header) {
32
- printf("%s%c", header, diff_options.line_termination);
33
+ if (!no_commit_id)
34
+ printf("%s%c", header, diff_options.line_termination);
35
header = NULL;
36
}
37
diff_flush(&diff_options);
@@ -231,6 +233,10 @@ int main(int argc, const char **argv)
233
show_root_diff = 1;
234
continue;
235
}
236
+ if (!strcmp(arg, "--no-commit-id")) {
237
+ no_commit_id = 1;
238
+ continue;
239
+ }
240
usage(diff_tree_usage);
241
}
242
if (diff_options.output_format == DIFF_FORMAT_PATCH)