mauris mauris - 4 months ago 45
Git Question

git log shows diff despite --no-patch

I'm using Git v2.10.2 (finally an update) on macOS Sierra. I noticed in the

git log
command, whenever I use the
argument to look at specific lines of code of a file,
git log
prints out the diff output even when
is specified clearly. Without the
, it works as it should behaves.

Is there something I'm missing with the
parameter? Thanks!

Sample command:

git log --oneline --no-patch -L 1,3:package.json


--no-patch doesn't make sense with -L and therefore it is ignored. By providing the -L option, you select a range of lines in the specified revision of a file and tell git to show the history of that fragment, which cannot be done without showing diffs.