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

Indicate merged branches in left panel #8035

Merged
4 commits merged into from May 23, 2020

Conversation

mstv
Copy link
Member

@mstv mstv commented Apr 23, 2020

Fixes #6494

Proposed changes

  • icons for branch nodes
  • git command
  • set icons in dependency on RevisionGridControl.LastSelected

Screenshots

Before

grafik

After

grafik

Test methodology

  • add NUnit test
  • manual

Test environment(s)

  • Git Extensions 3.3.0
  • Build d6e1245
  • Git 2.26.0.windows.1
  • Microsoft Windows NT 6.2.9200.0
  • .NET Framework 4.8.4121.0
  • DPI 96dpi (no scaling)

✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned mstv Apr 23, 2020
@mstv mstv added the up-for-grabs Easy tasks for those looking to get involved. Refer to https://up-for-grabs.net/ label Apr 23, 2020
@codecov
Copy link

codecov bot commented Apr 23, 2020

Codecov Report

Merging #8035 into master will decrease coverage by 0.00%.
The diff coverage is 84.28%.

@@            Coverage Diff             @@
##           master    #8035      +/-   ##
==========================================
- Coverage   49.51%   49.50%   -0.01%     
==========================================
  Files         849      849              
  Lines       61019    61050      +31     
  Branches    10965    10979      +14     
==========================================
+ Hits        30213    30224      +11     
+ Misses      28580    28564      -16     
- Partials     2226     2262      +36     
Flag Coverage Δ
#production 37.31% <82.53%> (-0.01%) ⬇️
#tests 94.81% <100.00%> (-0.01%) ⬇️

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mstv mstv force-pushed the feature/6494_merged_branches branch 2 times, most recently from 18393c7 to d6e1245 Compare May 3, 2020 00:20
@mstv mstv added 👓 status: needs review and removed up-for-grabs Easy tasks for those looking to get involved. Refer to https://up-for-grabs.net/ labels May 3, 2020
@mstv mstv changed the title WIP: Indicate merged branches in left panel Indicate merged branches in left panel May 3, 2020
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice
Well presented

cancellationToken.ThrowIfCancellationRequested();
var mergedBranches
= selectedGuid == null ? new HashSet<string>()
: (await Module.GetMergedBranchesAsync(includeRemote: true, fullRefname: true, commit: selectedGuid)).ToHashSet();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This adds 100 ms CPU time for me in a GE repo with 600 ms on my local relative new PC with Windows Defender. As a comparision git-status requires 150 ms. On repos with viruses like Symantec this can be substantially more even if git-status should have a greater hit (as more files are read there). This is async and will not affect the interactivity and should have a minimal impact on the perceived CPU use by GE.

@@ -112,10 +112,46 @@ protected void SelectRevision()
}
}

private sealed class LocalBranchNode : BaseBranchNode, IGitRefActions, ICanRename, ICanDelete
private class BaseBranchLeafNode : BaseBranchNode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a separate file?
(For me this is fine, but there are other with more opinions reviewing later, you know who I mean.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, are you fan of "him who we do not name" or "he who must not be named"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to break all nested classes into own files. I'm not going to block the PR for this though, it is a separate clean up task.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OT: I know who reads and know all, so if I use the name or not makes no difference

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to break all nested classes into own files.

I thought about it. But there were bugs to analyze as now again.
Perhaps I'll cleanup this in this PR later.

GitUI/BranchTreePanel/RepoObjectsTree.cs Outdated Show resolved Hide resolved
Comment on lines 245 to 246
var mergedBranches
= selectedGuid == null ? new HashSet<string>()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var mergedBranches
= selectedGuid == null ? new HashSet<string>()
var mergedBranches = selectedGuid == null
? new HashSet<string>()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be Array.Empty<string>?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be Array.Empty<string>?

I need something for lookups. Would become Array.Empty<string>().ToHashSet() because HashSet lacks Empty.

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@RussKie
Copy link
Member

RussKie commented May 23, 2020

I'd like to take this into 3.4. I suggest just rebase on top of 3.4 for that, instead of the master.

@RussKie RussKie added this to the 3.4 milestone May 23, 2020
@mstv
Copy link
Member Author

mstv commented May 23, 2020

@msftbot merge in 4 hours

@ghost ghost added the status: auto merge label May 23, 2020
@ghost
Copy link

ghost commented May 23, 2020

Hello @mstv!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Sat, 23 May 2020 23:24:04 GMT, which is in 4 hours

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 71a6164 into gitextensions:master May 23, 2020
@ghost ghost modified the milestones: 3.4, 4.0 May 23, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Left panel: indicate whether branch has been merged
3 participants