git rev-list --all --reflog does not include worktree references

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When running git rev-list --all --reflog in the main worktree it doesn't
include commits only referenced by the worktrees, neither HEAD nor its
reflog.

$ git init test
$ cd test
# add some commits
$ touch 1; git add 1; git commit -m 1
$ touch 2; git add 2; git commit -m 2
# add new worktree
$ git worktree add ../test2 master^{}
$ cd ../test2
# add more commits
$ touch 3; git add 3; git commit -m 3
$ touch 4; git add 4; git commit -m 4
# create an unreferenced commit
$ git checkout @^
# both commands should give the same number of commits
$ git rev-list --reflog | wc -l
4
$ git -C ../test rev-list --all --reflog | wc -l
2

IIUC this will cause git gc to prune references from worktrees too
early.

Andreas.

-- 
Andreas Schwab, schwab@xxxxxxxxxxxxxx
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]