Git push dialog: Sort active git branch to top and select it automatically#9385
Git push dialog: Sort active git branch to top and select it automatically#9385OndroMih wants to merge 1 commit into
Conversation
Select it automatically unless it contains destructive actions. Sort active tag to top, do not select it automatically. Display "(active)" next to the branch/tag name.
matthiasblaesing
left a comment
There was a problem hiding this comment.
The idea makes sense to me. I.e. having the active branch on top as that is the most likely branch to be relevant for the user. Also selecting it if the target does not yet exist makes sense IMHO.
However I left two inline comments for your consideration.
| this.active = active; | ||
| String displayName = localName; | ||
| if (active && localName != null) { | ||
| displayName = localName + " (active)"; //NOI18N |
There was a problem hiding this comment.
I think the NOI18N tag is invalid here. If anyone wants to localize this is a good candidate.
| } | ||
| } | ||
| boolean preselected = !conflicted && updateNeeded; | ||
| boolean preselected = !conflicted && (updateNeeded || branch.isActive()); |
There was a problem hiding this comment.
I think the branch.isActive() check should only be considered if remoteBranch is null. If remoteBranch is non-null, the logic already does the right thing, only new branches need to be considered.
Currently this can happen:
The checked state for the active branch makes no sense, as there is nothing to push.
Select it automatically unless it contains destructive actions.
Sort active tag to top, do not select it automatically.
Display "(active)" next to the branch/tag name.
^Add meaningful description above
Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)