forked from ThePrimeagen/git-worktree.nvim
-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Enable upstream tracking #32
Open
rbmarliere
wants to merge
12
commits into
polarmutex:main
Choose a base branch
from
rbmarliere:track_upstream
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently, the user experience when creating worktrees that track remote upstreams are not straight forward. This patch improves it by allowing the user to pass any ref to the --track option of git.
This is especially useful when creating or deleting a worktree, to avoid deleting errors if the user is within the to-be deleted worktree or unintended nested paths when creating.
Follow the same naming convention of the main picker.
This means that a user can create a worktree when there is none, so allow for an empty worktree list by not returning early if #results == 0.
Other pickers already use <c-d> for scrolling preview and telescope-file-browser.nvim use <m-d> for deleting files, so use that for consistency.
This corrects the output and make unnecessary to make use of :gsub and :trim.
Currently, if the user chooses a remote branch to checkout, it will be created locally with the same name causing it to produce an ambiguous ref which git won't be able to use as upstream to track. This defaults the new local branch to be prefixed with "local/".
rbmarliere
force-pushed
the
track_upstream
branch
2 times, most recently
from
September 21, 2024 13:21
a8e7c38
to
657538f
Compare
rbmarliere
force-pushed
the
track_upstream
branch
from
September 21, 2024 16:12
657538f
to
0f6da26
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As previously discussed in PR 20 and now mentioned in issue 30, dealing with remote tracking trees currently does not have a good user experience. This pull request addresses this, while also adding a necessary feature to make that experience even smoother: switching directories back to the bare repository. Finally, a few minor fixes.
There are still some rough edges mentioned in some new TODOs and other minor stuff like properly announcing when the jobs ended, but those can be addressed later.