Subject: git log -g bizarre behaviour

From: Dennis Kaarsemaker <[email-masked]>
Date: Sun, 31 Jan 2016 12:52:24 +0100

I'm attempting to understand the log [-g] / reflog code enough to
untangle them and make reflog walking work for more than just commit
objects [see gmane 283169]. I found something which I think is wrong,
and would break after my changes.

git log -g HEAD^ and git log -g v2.7.0^ give no output. This is
expected, as those are not things that have a reflog. But git log -g
v2.7.0 seems to ignore -g and gives the normal log. git reflog v2.7.0
does something even more bizarre:

$ GIT_PAGER= git reflog v2.7.0 
7548842 (tag: v2.7.0, seveas/master, origin/master, origin/HEAD) 3e9226a 833e482 (tag: v2.6.5, gitster/maint-2.6) e3073cf e002527 e54d0f5 06b5c93 34872f0 5863990 02103b3 503b1ef 28274d0 (tag: v2.7.0-rc3) aecb997 7195733 e929264 ce858c0 5fa9ab8

Yes, that's a humongous line (I've only copied parts of it).

I'd like to make git log -g / git reflog abort early when trying to
display a reflog of a ref that has no reflog. Objections?

-- 
Dennis Kaarsemaker
www.kaarsemaker.net