Gitnuro
Gitnuro copied to clipboard
Improve error messages
Whenever is possible, errors should give more details to the user about what has caused the issue, how can it be solved and if there are any alternatives.
Example:
List of issues that should show a custom error dialog:
- [ ] Trying to checkout a remote branch when there is an exiting local branch with the same name.
- [ ] Option to turn off SSL verification for specific repository (or provide the option to import a certificate, related to #48).
- [ ] Having a missconfigured (or unsupported) credentials manager should provide a more descriptive message.
- WIP...
From @adam-ce at #119 . Better error message when trying to checkout a remote branch with an existing local branch.
Describe the bug you can't check out a branch via the remote handle visible in the tree, if it was checked out before, but is not up-to-date. An error pops up, saying "Ref branch_name already exists".
To Reproduce
1. create a repo with a main branch 'main' on machine A 2. create a branch 'B' on machine A 3. push to a remote (e.g. github) from machine A 4. clone the remote on a different machine B 5. checkout 'B' on machine B 6. checkout 'main' on the machine B 7. commit something to 'B' on machine A 8. push to the remote on machine A 9. pull / fetch the branch main on machine B (the commit to branch 'B' will become visible in the tree view). 10. try checking out 'origin/B' on machine B (it'll fail) 11. checking out 'B' (the local branch) on machine B works (but the local branch might be so many commits behind, that it is outside of the view)
Expected behavior
a text 'checkout origin/B' might be confusing as a menu entry (since the branch is already locally available, and might contain other commits). so therefore i would expect an entry saying 'checkout local branch and pull', or only 'checkout local branch'.
Desktop (please complete the following information):
* OS: linux (kubuntu 22.04) * Version 1.2.1 via flathub
Additional comment from @JetpackDuba :
Something else to add is that in some specific cases, the local branch may not be referencing the remote branch with the same name, as you can have multiple remotes. There is also the case where a local branch named X references a remote branch named Y, making things even harder.
Probably the first case should is the most relevant but both cases should be investigated.
local branches posses the information about what they are tracking. so one should not 'name match', but instead use that tracking information. best to also show it in the gui.