On Tue, Jul 28, 2020 at 09:48:20AM -0700, Junio C Hamano wrote: > Jeff King <peff@xxxxxxxx> writes: > > > For some projects, it's useful to walk the first parent history, looking > > at each merge commit as a normal commit introducing all of the changes > > no its side branch. E.g.: > > > > git log --first-parent -m -Sfoo -p > > > > might show you the topic or pull request that introduced code "foo". But > > I quite often forget to add "-m", and get confused that it doesn't > > return any results. > > Yes. I agree that --first-parent should imply -m when combined with > diff options like -p, --raw, etc. I am not sure if -m should kick > in without any diff options, though. Doesn't it have side effects? I couldn't find any. It impacts log_tree_diff() if we see a commit with two parents, but --first-parent will already override that. I poked around in the code and couldn't find any other cases that would be impacted, nor do any tests fail. Definitely if you can find a case where it matters outside of the diff, I'd be interested to see it. :) -Peff