On Thu Mar 14, 2024 at 4:31 AM AEDT, Junio C Hamano wrote: > James Liu <james@xxxxxxxxxxx> writes: > > > However, when --oneline is used in combination with -L, Git actually > > outputs the single line commit information _as well_ as the full diff. > > For example: > > > > git log --oneline -L 660:Documentation/MyFirstObjectWalk.txt > > > > will incorrectly display the diffs too. > > Why is it incorrect? > > * "git log" takes options to tweak formatting of the commit log, > options to tweak what commits are chosen, and options to tweak > how the diff are shown. > > * "--oneline" tweaks how the log message gets shown. Others in the > family are --pretty=fuller, --format='%h %s', etc. > > * "-L" tweaks how the diff gets shown (e.g. limits which part of > the diff is shown) and what commits are shown (e.g. limits to > commits that touch the specified area). I suppose it isn't intuitive to me which options affect how the commits are presented, and which affect the diffs. The help entry for -L states that it will "Trace the evolution of the line range", which doesn't immediately suggest that it tweaks how the log message is shown. As a user of this option, I'm more interested in using it as a filter for how commits are chosen. -S feels like a similar option to -L, but will omit the diff when used with --oneline. I think I was probably experimenting with "--oneline -S" and then was surprised to see diffs after trying "--oneline -L".