blame: add --line-porcelain output format
This is just like --porcelain, except that we always output the commit information for each line, not just the first time it is referenced. This can make quick and dirty scripts much easier to write; see the example added to the blame documentation. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e86226e340
commit
ed747dd521
@ -52,6 +52,11 @@ of lines before or after the line given by <start>.
|
||||
--porcelain::
|
||||
Show in a format designed for machine consumption.
|
||||
|
||||
--line-porcelain::
|
||||
Show the porcelain format, but output commit information for
|
||||
each line, not just the first time a commit is referenced.
|
||||
Implies --porcelain.
|
||||
|
||||
--incremental::
|
||||
Show the result incrementally in a format designed for
|
||||
machine consumption.
|
||||
|
@ -105,6 +105,19 @@ 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.
|
||||
|
||||
The porcelain format generally suppresses commit information that has
|
||||
already been seen. For example, two lines that are blamed to the same
|
||||
commit will both be shown, but the details for that commit will be shown
|
||||
only once. This is more efficient, but may require more state be kept by
|
||||
the reader. The `--line-porcelain` option can be used to output full
|
||||
commit information for each line, allowing simpler (but less efficient)
|
||||
usage like:
|
||||
|
||||
# count the number of lines attributed to each author
|
||||
git blame --line-porcelain file |
|
||||
sed -n 's/^author //p' |
|
||||
sort | uniq -c | sort -rn
|
||||
|
||||
|
||||
SPECIFYING RANGES
|
||||
-----------------
|
||||
|
Reference in New Issue
Block a user