Re: What's cooking in git.git (topics)
From: Nicolas Pitre <hidden>
Date: 2016-06-15 22:42:51
On Sat, 27 Jan 2007, Nicolas Pitre wrote:
On Sat, 27 Jan 2007, Junio C Hamano wrote:quoted
My understanding of the situation after your patch (disregarding the problem that prune and friends may happily break the logs for detached HEAD), is that if you say "git show HEAD@{...}", while on a branch, it looks at the log of the current branch but while on a detached HEAD it shows the log from .git/logs/HEAD. I have a feeling that this would be confusing.It would indeed. But that's not exactly what's happening.
Well... It is a mess. That's not what's happening for git-log obviously, but what you describe is indeed the case for git-rev-parse. There needs to be a dwim_reflog() function that looks for a matching reflog file by itself instead of using dwim_ref() and simply prefixing the resolved ref with "logs/". Unfortunately this tackling of reflog path built on top of resolve_ref() seems to be a popular assumption and chasing and fixing all those cases properly would require more time than I can spare right now. Nicolas