@matheusbsbs / matheus-bagliano / commits / 57e7a0a494
Fork 0

Document 'git-blame --incremental'

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jan 28, 2007 at 12:21 UTC 57e7a0a49496fa3c2b2514b6a23ad661ecb428a6
1 file changed +46 -1
Documentation/git-blame.txt
+46 -1
@@ -8,7 +8,7 @@ git-blame - Show what revision and author last modified each line of a file
8 SYNOPSIS
9 --------
10 [verse]
11 -'git-blame' [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>]
11 +'git-blame' [-c] [-l] [-t] [-f] [-n] [-p] [--incremental] [-L n,m] [-S <revs-file>]
12 [-M] [-C] [-C] [--since=<date>] [<rev>] [--] <file>
13
14 DESCRIPTION
@@ -63,6 +63,10 @@ OPTIONS
63 -p, --porcelain::
64 Show in a format designed for machine consumption.
65
66 +--incremental::
67 + Show the result incrementally in a format designed for
68 + machine consumption.
69 +
70 -M::
71 Detect moving lines in the file as well. When a commit
72 moves a block of lines in a file (e.g. the original file
@@ -158,6 +162,47 @@ parents, using `commit{caret}!` notation:
162 git blame -C -C -f $commit^! -- foo
163
164
165 +INCREMENTAL OUTPUT
166 +------------------
167 +
168 +When called with `--incremental` option, the command outputs the
169 +result as it is built. The output generally will talk about
170 +lines touched by more recent commits first (i.e. the lines will
171 +be annotated out of order) and is meant to be used by
172 +interactive viewers.
173 +
174 +The output format is similar to the Porcelain format, but it
175 +does not contain the actual lines from the file that is being
176 +annotated.
177 +
178 +. Each blame entry always starts with a line of:
179 +
180 + <40-byte hex sha1> <sourceline> <resultline> <num_lines>
181 ++
182 +Line numbers count from 1.
183 +
184 +. The first time that commit shows up in the stream, it has various
185 + other information about it printed out with a one-word tag at the
186 + beginning of each line about that "extended commit info" (author,
187 + email, committer, dates, summary etc).
188 +
189 +. Unlike Porcelain format, the filename information is always
190 + given and terminates the entry:
191 +
192 + "filename" <whitespace-quoted-filename-goes-here>
193 ++
194 +and thus it's really quite easy to parse for some line- and word-oriented
195 +parser (which should be quite natural for most scripting languages).
196 ++
197 +[NOTE]
198 +For people who do parsing: to make it more robust, just ignore any
199 +lines in between the first and last one ("<sha1>" and "filename" lines)
200 +where you don't recognize the tag-words (or care about that particular
201 +one) at the beginning of the "extended information" lines. That way, if
202 +there is ever added information (like the commit encoding or extended
203 +commit commentary), a blame viewer won't ever care.
204 +
205 +
206 SEE ALSO
207 --------
208 gitlink:git-annotate[1]