Thread (20 messages) flat view 20 messages, 3 authors, 2017-02-25

HEAD's reflog entry for a renamed branch

From: Kyle Meyer <hidden>
Date: 2017-01-16 23:18:13

Hello,

I noticed that, after renaming the current branch, the corresponding
message in .git/logs/HEAD is empty.

For example, running

    $ mkdir test-repo
    $ cd test-repo
    $ git init
    $ echo abc >file.txt
    $ git add file.txt
    $ git commit -m"Add file.txt"
    $ git branch -m master new-master

resulted in the following reflogs:

   $ cat .git/logs/refs/heads/new-master
   00000... 68730... Kyle Meyer [off-list ref] 1484607020 -0500	commit (initial): Add file.txt
   68730... 68730... Kyle Meyer [off-list ref] 1484607020 -0500	Branch: renamed refs/heads/master to refs/heads/new-master

   $ cat .git/logs/HEAD
   00000... 68730... Kyle Meyer [off-list ref] 1484607020 -0500	commit (initial): Add file.txt
   68730... 00000... Kyle Meyer [off-list ref] 1484607020 -0500

I expected the second line of .git/logs/HEAD to mirror the second line
of .git/logs/refs/heads/new-master.  Are the empty message and null sha1
in HEAD's entry intentional?

--
Kyle
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help