summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f789e34)
raw | patch | inline | side by side (parent: f789e34)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 12 Oct 2006 07:44:27 +0000 (00:44 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 12 Oct 2006 07:44:27 +0000 (00:44 -0700) |
New options --show-name, --show-number and --porcelain were not
documented. Also add -p as a short-hand for --porcelain for
consistency.
Signed-off-by: Junio C Hamano <junkio@cox.net>
documented. Also add -p as a short-hand for --porcelain for
consistency.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-blame.txt | patch | blob | history | |
blame.c | patch | blob | history |
index e1f89444a95618a1e520940a79389c854cf9d576..9891c1d3779185c200345c0e6d92763aa155a169 100644 (file)
SYNOPSIS
--------
-'git-blame' [-c] [-l] [-t] [-S <revs-file>] [--] <file> [<rev>]
+'git-blame' [-c] [-l] [-t] [-f] [-n] [-p] [-S <revs-file>] [--] <file> [<rev>]
DESCRIPTION
-----------
-S, --rev-file <revs-file>::
Use revs from revs-file instead of calling gitlink:git-rev-list[1].
+-f, --show-name::
+ Show filename in the original commit. By default
+ filename is shown if there is any line that came from a
+ file with different name, due to rename detection.
+
+-n, --show-number::
+ Show line number in the original commit (Default: off).
+
+-p, --porcelain::
+ Show in a format designed for machine consumption.
+
-h, --help::
Show help message.
+THE PORCELAIN FORMAT
+--------------------
+
+In this format, each line is output after a header; the
+header at the minumum has the first line which has:
+
+- 40-byte SHA-1 of the commit the line is attributed to;
+- the line number of the line in the original file;
+- the line number of the line in the final file;
+- on a line that starts a group of line from a different
+ commit than the previous one, the number of lines in this
+ group. On subsequent lines this field is absent.
+
+This header line is followed by the following information
+at least once for each commit:
+
+- author name ("author"), email ("author-mail"), time
+ ("author-time"), and timezone ("author-tz"); similarly
+ for committer.
+- filename in the commit the line is attributed to.
+- the first line of the commit log message ("summary").
+
+The contents of the actual line is output after the above
+header, prefixed by a TAB. This is to allow adding more
+header elements later.
+
SEE ALSO
--------
gitlink:git-annotate[1]
index 314f3e2f0d93976ab300a4eecdd22b600b783be7..e664813cb48f555fa8968995eda4170a02a99f42 100644 (file)
--- a/blame.c
+++ b/blame.c
#define DEBUG 0
static const char blame_usage[] =
-"git-blame [-c] [-l] [-t] [-S <revs-file>] [--] file [commit]\n"
+"git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-S <revs-file>] [--] file [commit]\n"
" -c, --compatibility Use the same output mode as git-annotate (Default: off)\n"
" -l, --long Show long commit SHA1 (Default: off)\n"
" -t, --time Show raw timestamp (Default: off)\n"
-" -S, --revs-file Use revisions from revs-file instead of calling git-rev-list\n"
+" -f, --show-name Show original filename (Default: auto)\n"
+" -n, --show-number Show original linenumber (Default: off)\n"
+" -p, --porcelain Show in a format designed for machine consumption\n"
+" -S revs-file Use revisions from revs-file instead of calling git-rev-list\n"
" -h, --help This message";
static struct commit **blame_lines;
show_number = 1;
continue;
}
- if (!strcmp(argv[i], "--porcelain")) {
+ if (!strcmp(argv[i], "-p") ||
+ !strcmp(argv[i], "--porcelain")) {
porcelain = 1;
sha1_len = 40;
show_raw_time = 1;