ThePrimeagen / git-worktree.nvim

700 stars 121 forks source link

git-worktree v2 #115

Open polarmutex opened 10 months ago

polarmutex commented 10 months ago

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

ThePrimeagen commented 10 months ago

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!

polarmutex commented 10 months ago

Up to you, you had the original idea

ThePrimeagen commented 10 months ago

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.

polarmutex commented 10 months ago

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

ThePrimeagen commented 10 months ago

dealio,

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

polarmutex commented 10 months ago

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

arnevm123 commented 10 months ago

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 commented 10 months ago

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:

metzenseifner commented 3 weeks ago

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

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