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

[RFC] Set --track when creating a worktree #20

Closed
wants to merge 8 commits into from

Conversation

rbmarliere
Copy link

@rbmarliere rbmarliere commented Jul 21, 2024

This PR is not to be merged because it is based off these other two: #18 #19

Basically, instead of using git-branch with --set-upstream-to after creating a worktree, the plugin should simply use git-worktree --track instead. That would simplify things a lot for the case where upstream ~= nil in worktree.lua. I wanted to ask you what do you think the best approach should be here.

Thanks,

@rbmarliere rbmarliere marked this pull request as draft July 21, 2024 17:18
@@ -145,6 +153,11 @@ function M.create_worktree_job(path, branch, found_branch)
table.insert(worktree_add_args, branch)
end

if found_upstream then
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it only makes sense to use --track when the branch does not exist and -b is used in git-worktree add.

@rbmarliere
Copy link
Author

I have improved it a bit in my main branch, please let me know if you have interest so I can prepare a proper PR.

@polarmutex
Copy link
Owner

I am interested.

I am entering a busy period of the year. I will try to find time to look into it soon

@rbmarliere
Copy link
Author

Understood! I will send a proper PR later on then :)

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

Successfully merging this pull request may close these issues.

2 participants