threads / rfc / 16883

[git-new-workdir RFC] Backlinking $workdir/logs/HEAD to $GIT_DIR/logs/workdir?

Subject: [git-new-workdir RFC] Backlinking $workdir/logs/HEAD to $GIT_DIR/logs/workdir?

## tl;dr

2 messages between Dec 27, 2008 and Dec 27, 2008.

replies: 1people: 2as markdown or json

Adeodato Simó· Dec 27, 2008, 12:15 UTC · lore
Hello,

I use git new-workdir for some of my projects. Apart from the usual caveat "don't checkout the same branch twice", I found another small issue, surely known: the reflog for HEAD in the workidirs does not exist in the source git repo, hence git-gc will happily prune what it believes to be dangling commits.

Would it be, perhaps, be okay to create a logs/workdir/<name>/HEAD symlink pointing to $workdir/logs/HEAD, so that this does not happen?

Comments welcome.
-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
                                            Listening to: Niza - Parasol
Shawn O. Pearce· Dec 27, 2008, 17:26 UTC · re: Adeodato Simó · lore

Re: [git-new-workdir RFC] Backlinking $workdir/logs/HEAD to $GIT_DIR/logs/workdir?

Adeodato Simó <dato@net.com.org.es> wrote:
Show 8 quoted lines
> I use git new-workdir for some of my projects. Apart from the usual
> caveat "don't checkout the same branch twice", I found another small
> issue, surely known: the reflog for HEAD in the workidirs does not exist
> in the source git repo, hence git-gc will happily prune what it believes
> to be dangling commits.
> 
> Would it be, perhaps, be okay to create a logs/workdir/<name>/HEAD
> symlink pointing to $workdir/logs/HEAD, so that this does not happen?

You also need to link the ref. A log is only scanned if the ref by the same name is scanned.

So you'd need to create a refs/workdir/<name>/HEAD in the parent repository. Using a symlink to point to the HEAD file from the workdir might just work.

-- 
Shawn.

← back to recent threads