summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-03-07 19:45:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-08 01:27:01 (GMT)
commit9f607cd09c4c953d76de4bd18ba1c9bf6cf383cd (patch)
treea225418904c3997257cc2cabd27e6e378e3c6ff7 /t
parent36eb1cb9cfe327583128a4b0abdf9516c2ca815b (diff)
downloadgit-9f607cd09c4c953d76de4bd18ba1c9bf6cf383cd.zip
git-9f607cd09c4c953d76de4bd18ba1c9bf6cf383cd.tar.gz
git-9f607cd09c4c953d76de4bd18ba1c9bf6cf383cd.tar.bz2
line-log: suppress diff output with "-s"
When "-L" is in use, we ignore any diff output format that the user provides to us, and just always print a patch (with extra context lines covering the whole area of interest). It's not entirely clear what we should do with all formats (e.g., should "--stat" show just the diffstat of the touched lines, or the stat for the whole file?). But "-s" is pretty clear: the user probably wants to see just the commits that touched those lines, without any diff at all. Let's at least make that work. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4211-line-log.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index bd5fe4d..c9f2036 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -115,4 +115,11 @@ test_expect_success 'range_set_union' '
git log $(for x in $(test_seq 200); do echo -L $((2*x)),+1:c.c; done)
'
+test_expect_success '-s shows only line-log commits' '
+ git log --format="commit %s" -L1,24:b.c >expect.raw &&
+ grep ^commit expect.raw >expect &&
+ git log --format="commit %s" -L1,24:b.c -s >actual &&
+ test_cmp expect actual
+'
+
test_done