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

Enable upstream tracking #32

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

rbmarliere
Copy link

@rbmarliere rbmarliere commented Sep 15, 2024

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.

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 rbmarliere force-pushed the track_upstream branch 2 times, most recently from a8e7c38 to 657538f Compare September 21, 2024 13:21
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.

1 participant