Gitup: Make GitUp compatible with worktrees

Created on 3 Mar 2016  路  8Comments  路  Source: git-up/GitUp

Since a few months git supports a feature called worktrees (https://git-scm.com/docs/git-worktree) which is a very nifty feature to work with multiple branches of a repository at once, possibly interacting between them, while having the data only exactly once.

To realise this .git in a worktree directory is not a directory as usual but a file pointing to the metadata for this specific worktree inside the main directory. The directory pointed to contain information about the usual .git structure relevant for GitUp.

At the moment I'm using GitUp as a quick way to figure out whether a clone is actually a worktree or not:

# gitup
No repository found at current path

but of course I'd prefer if GitUp was able to operate on it instead. ;)

Please consider including support for that in future versions. Thanks for your attention and great work.

enhancement

Most helpful comment

@swisspol https://github.com/libgit2/libgit2/pull/3436 (PR of the issue https://github.com/libgit2/libgit2/issues/3159) got merged yesterday!

All 8 comments

@swisspol https://github.com/libgit2/libgit2/pull/3436 (PR of the issue https://github.com/libgit2/libgit2/issues/3159) got merged yesterday!

I'd love to see worktree's supported. I've started to use them, and had to switch back to SourceTree for any worktrees.

I've updated libgit in my fork of gitup to v0.26.0, and the worktrees now work. You cannot manage them from gitup, but you can work within the worktree with gitup.

@swisspol Would you be interested in merging this to your repo? If so, any special caveats besides the usual CONTRIBUTING.md? The upgrade of libgit was pretty straightforward, I just had to add a bunch of new files, rename a struct member in one of your modifications of libgit, and add a new preprocessor flag.

Erm, I was too quick. The repository opens and the commit tree is displayed correctly, but the actual work tree doesn't work.

Turns out everything is working after all. I was testing it on a corrupted worktree repo.

So my initial question holds鈥攚ould you be interested in merging this to your repo?

@jhrmnn Were you still interested in contributing these changes? I know it's been a while but we're trying to start active development once again for GitUp 馃槃

Libgit in GitUp was actually upgraded to 0.26 by Pierre in b75dd191 a couple of weeks after my comment above. So this issue can be closed.

Was this page helpful?
0 / 5 - 0 ratings