Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-worktree v2 #115

Open
polarmutex opened this issue Nov 7, 2023 · 9 comments
Open

git-worktree v2 #115

polarmutex opened this issue Nov 7, 2023 · 9 comments

Comments

@polarmutex
Copy link
Collaborator

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 polarmutex pinned this issue Nov 7, 2023
@ThePrimeagen
Copy link
Owner

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
Copy link
Collaborator Author

Up to you, you had the original idea

@ThePrimeagen
Copy link
Owner

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
Copy link
Collaborator Author

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

@ThePrimeagen
Copy link
Owner

dealio,

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

@polarmutex
Copy link
Collaborator Author

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

@arnevm123
Copy link

arnevm123 commented Nov 10, 2023

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
Copy link

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

#96

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

@metzenseifner
Copy link

metzenseifner commented Aug 21, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants