git-worktree.nvim icon indicating copy to clipboard operation
git-worktree.nvim copied to clipboard

git-worktree v2

Open polarmutex opened this issue 2 years ago • 9 comments

i am looking into git-worktree v2 in honor of harpoon v2

I will try to cleanup issues / prs as well

Please comment with requests to add/modify features

My first priority is cleaning up the code to make it more maintainable

polarmutex avatar Nov 07 '23 21:11 polarmutex

would you like to fork this and have a "deprecation" message pointing towards your repo? i feel bad having you do all this work with not the full recognition you deserve!

ThePrimeagen avatar Nov 07 '23 21:11 ThePrimeagen

Up to you, you had the original idea

polarmutex avatar Nov 07 '23 23:11 polarmutex

Up to you, you had the original idea

NO! Its up to you! If you truly don't care, then i don't care. But if you would like that, i am here to support you. It requires work on your behalf. I am here to multiply not to own, i am fine letting go.

ThePrimeagen avatar Nov 08 '23 21:11 ThePrimeagen

If you have no plans to maintain it, sure I can take it over

polarmutex avatar Nov 09 '23 20:11 polarmutex

dealio,

you can squash me out and or keep me. make your repo and we will point it over to yours!

ThePrimeagen avatar Nov 09 '23 21:11 ThePrimeagen

https://github.com/polarmutex/git-worktree.nvim

polarmutex avatar Nov 09 '23 23:11 polarmutex

Right now I'm always linking my files that I have put in my .gitignore over to each new worktree. It would be nice to have something like this as a feature I think. (I also think paths for the "on_create" are a bit broken)

This is how I handle this for reference:

Worktree.on_tree_change(function(op, metadata)
    local Path = require("plenary.path")
    if op == Worktree.Operations.Create then
        -- If we're dealing with create, the path is relative to the worktree and not absolute
        -- so we need to convert it to an absolute path.
        local path = metadata.path
        if not Path:new(path):is_absolute() then
            path = Path:new():absolute()
            if path:sub(-#"/") == "/" then
                path = string.sub(path, 1, string.len(path) - 1)
            end
        end
	local base_path = string.match(path, "(.-)%.git") .. ".git"
	local worktree_path = base_path .. "/" .. metadata.path .. "/"
        local link_gitignored = "ln -s " .. gitignored_path .. "/{*,.*} " .. worktree_path
        os.execute(link_gitignored)
    end
end)

arnevm123 avatar Nov 10 '23 16:11 arnevm123

Adding this feature would be nice as well. It make the whole worktree experience a lot cleaner imo.

https://github.com/ThePrimeagen/git-worktree.nvim/issues/96

I'm not sure if I can help with any of this, if there's anything I can do, please let me know :smile:

arnevm123 avatar Nov 11 '23 08:11 arnevm123

https://github.com/polarmutex/git-worktree.nvim

I would have liked to have had this on the README. This was a challenge to find!

metzenseifner avatar Aug 21 '24 14:08 metzenseifner