Re: HEAD's reflog entry for a renamed branch
- From
Jeff King <peff@peff.net>
- Date
- Jan 26, 2017, 21:53 UTC
- Message-ID
- <20170126215309.n2lr6q5doidhzcf5@sigill.intra.peff.net>
- In-Reply-To
- <xmqqk29h33w1.fsf@gitster.mtv.corp.google.com>
On Thu, Jan 26, 2017 at 01:30:54PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> > - "git branch -m" does seem to realize when we are renaming HEAD, > > because it updates HEAD to point to the new branch name. But it > > should probably insert another reflog entry mentioning the rename > > (we do for "git checkout foo", even when "foo" has the same sha1 as > > the current HEAD). > > This one I care less (not in the sense that I prefer it not done, > but in the sense that I do not mind it is left unfixed than the > other one you pointed out).
I wondered if it might affect how "git checkout -" works. But that feature looks for reflogs like "checkout: moving from X to Y" to know to move back to X. So we are fine here. Even though the HEAD reflog does not show us going _to_ new-master, we would see it in a later entry as "from new-master to Y". What we are missing is "rename from master to new-master", but that entry does not matter. There is no "master" to go back to anymore. :)
-Peff