summaryrefslogtreecommitdiff
path: root/line-log.c
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 /line-log.c
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 'line-log.c')
-rw-r--r--line-log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/line-log.c b/line-log.c
index 24e2173..59248e3 100644
--- a/line-log.c
+++ b/line-log.c
@@ -1103,10 +1103,12 @@ static int process_all_files(struct line_log_data **range_out,
int line_log_print(struct rev_info *rev, struct commit *commit)
{
- struct line_log_data *range = lookup_line_range(rev, commit);
show_log(rev);
- dump_diff_hacky(rev, range);
+ if (!(rev->diffopt.output_format & DIFF_FORMAT_NO_OUTPUT)) {
+ struct line_log_data *range = lookup_line_range(rev, commit);
+ dump_diff_hacky(rev, range);
+ }
return 1;
}