-
Notifications
You must be signed in to change notification settings - Fork 223
feature: double tap specific branch #1416
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
base: develop
Are you sure you want to change the base?
Conversation
Double-clicking commit in HISTORY commit list to switch branches only provides a convenient way. In this mode, there are its unique rules, such as:
If the current commit is the HEAD of multiple local branches, the program also provides other ways, such as:
For the functions of branches, in different parts of the software, the functions we provide are not exactly the same, and each has its own pertinence. For example, the functions related to branches in the context menu of the commit list are much fewer than those provided in the branch tree. |
Understood. This PR makes double clicking on a commit ref |
What I mean is that I only hope the functions here to be simple and the rules to be clear. In your implementation, double-clicking on a commit has too many different results.
|
One more important thing is - The result of double-clicking on a commit must be strongly related to that commit. In your PR: if (localBranch.TrackStatus.Behind.Count == 0)
_repo.CheckoutBranch(localBranch); After checking out the local branch that tracking on the remote branch, the HEAD may be different with clicking one You can review the original code of |
Minor side-note: if (double-/right-)clicking on a specific |
I've tweaked the behavior so that double clicking on a branch ref/decorator in history exactly mirrors double clicking on that same branch in the left sidebar. FWIW, I modeled this PR on the behavior of gitfork, which is what I personally migrated from (when I used to be on Windows) and what this project seems to take some inspiration from. |
Checkout the branch the user actually double tapped on, not just the first branch decorator on the commit.
I am not experienced with Avalonia so this is definitely not an idiomatic implementation, but it works as a proof of concept. Most notably the
DecoratorAt
method I added toCommitRefsPresenter
which maps the mouse location to a commit decorator based on where it was likely rendered.Please refactor as needed!