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
@ -68,4 +68,23 @@ test_expect_success 'blame --porcelain output' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
$ID1 1 1 1
|
||||
$COMMIT1
|
||||
a
|
||||
$ID2 2 2 3
|
||||
$COMMIT2
|
||||
b
|
||||
$ID2 3 3
|
||||
$COMMIT2
|
||||
c
|
||||
$ID2 4 4
|
||||
$COMMIT2
|
||||
d
|
||||
EOF
|
||||
test_expect_success 'blame --line-porcelain output' '
|
||||
git blame --line-porcelain file >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user