git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] log: make the --oneline option work with -L
@ 2024-03-13  9:08 James Liu
  2024-03-13  9:08 ` [PATCH 1/1] log: ensure diffs are omitted with --oneline James Liu
  2024-03-13 17:31 ` [PATCH 0/1] log: make the --oneline option work with -L Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: James Liu @ 2024-03-13  9:08 UTC (permalink / raw)
  To: git; +Cc: James Liu

Hey folks,

This is a small patch to fix an issue I've experienced with git-log(1)
when certain combinations of flags are provided. This is also my very
first patch submission, so I've tried to limit the blast radius as much
as possible. I'm also unsure if this is the best place to implement the
change, so any feedback is welcome!

I'd like to ideally add a test as well, but I'm unsure where this should
slot in.

git-log accepts the --oneline option to display the short commit SHA and
title only. This is a convenient option when searching through Git
history, as it gives a rough idea of the changes introduced in each
commit. git-log also accepts the -L flag, which lets us provide a line
range for a given file. This is handy for limiting the search to a given
area of interest.

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.

This patch aims to fix this behaviour by respecting the --oneline option
when used in conjunction with -L.

James Liu (1):
  log: ensure diffs are omitted with --oneline

 builtin/log.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.43.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-13 22:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13  9:08 [PATCH 0/1] log: make the --oneline option work with -L James Liu
2024-03-13  9:08 ` [PATCH 1/1] log: ensure diffs are omitted with --oneline James Liu
2024-03-13 17:31 ` [PATCH 0/1] log: make the --oneline option work with -L Junio C Hamano
2024-03-13 18:08   ` Beat Bolli
2024-03-13 22:25     ` James Liu
2024-03-13 22:24   ` James Liu
2024-03-13 22:47     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).