# dangling commits in worktree

3 messages from 2016-11-23 to 2016-11-23. Participants: Van Oostenryck Luc, Duy Nguyen, Luc Van Oostenryck.
Thread: https://gitlist.dev/t/44537

## Van Oostenryck Luc, 2016-11-23 00:52

Subject: dangling commits in worktree
Message-ID: <CAExDi1SYOuq7GJC69+5yDmzaw--vKMmmqv0Jsm80hU1L5phDUg@mail.gmail.com>
URL: https://gitlist.dev/e/CAExDi1SYOuq7GJC69%2B5yDmzaw--vKMmmqv0Jsm80hU1L5phDUg%40mail.gmail.com

```
Hi,

More or less by error I used the fsck command in a worktree and I had
the surprised to see that it reported a lot of dangling commits while it was
not supposed to have one.
I quickly realized that it was the case only in the worktree, in the main dir
things were OK. While experimenting a bit I also saw that git gc had not the
same effect in a worktree than in the main tree (the pack was smaller, more
files were left in objects/xx/ dirs), which is even more odd and a bit
scary when thinking to the pruning.

This seems like a bug to me and googling about it didn't returned anything.

Luc Van Oostenryck

```

## Duy Nguyen, 2016-11-23 09:45

Subject: Re: dangling commits in worktree
Message-ID: <CACsJy8CPX3PDfhcaftDHy_U37rEACr7Q1gj_un4ALen45J9GZQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8CPX3PDfhcaftDHy_U37rEACr7Q1gj_un4ALen45J9GZQ%40mail.gmail.com
In-Reply-To: <CAExDi1SYOuq7GJC69+5yDmzaw--vKMmmqv0Jsm80hU1L5phDUg@mail.gmail.com>

```
On Wed, Nov 23, 2016 at 7:52 AM, Van Oostenryck Luc
<luc.vanoostenryck@gmail.com> wrote:
> Hi,
>
> More or less by error I used the fsck command in a worktree and I had
> the surprised to see that it reported a lot of dangling commits while it was
> not supposed to have one.
> I quickly realized that it was the case only in the worktree, in the main dir
> things were OK. While experimenting a bit I also saw that git gc had not the
> same effect in a worktree than in the main tree (the pack was smaller, more
> files were left in objects/xx/ dirs), which is even more odd and a bit
> scary when thinking to the pruning.
>
> This seems like a bug to me and googling about it didn't returned anything.

It's a known issue that gc (and maybe some others that do rev-list
--all, like fsck) "forgets" about some worktree's refs and you will
see what you see. Work on it was postponed because the "refs"
subsystem was being refactored. I think I'm resuming it soon.
-- 
Duy

```

## Luc Van Oostenryck, 2016-11-23 14:15

Subject: Re: dangling commits in worktree
Message-ID: <20161123141502.GA10722@macbook.local>
URL: https://gitlist.dev/e/20161123141502.GA10722%40macbook.local
In-Reply-To: <CACsJy8CPX3PDfhcaftDHy_U37rEACr7Q1gj_un4ALen45J9GZQ@mail.gmail.com>

```
On Wed, Nov 23, 2016 at 04:45:56PM +0700, Duy Nguyen wrote:
> 
> It's a known issue that gc (and maybe some others that do rev-list
> --all, like fsck) "forgets" about some worktree's refs and you will
> see what you see.

Good. I just wanted to be sure it was a known problem.
Thanks for the info.

Luc

```
