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
FormBrowse: Add all supported shells to the toolbar #8213
Conversation
9bf0b97
to
5fc71bb
Compare
Codecov Report
@@ Coverage Diff @@
## master #8213 +/- ##
==========================================
+ Coverage 52.63% 52.65% +0.02%
==========================================
Files 857 863 +6
Lines 62464 62503 +39
Branches 11185 11189 +4
==========================================
+ Hits 32875 32910 +35
+ Misses 26969 26966 -3
- Partials 2620 2627 +7
|
Nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
5fc71bb
to
92cd410
Compare
Still need to address messagebox comments but here are custom shell icons... (with updated screenshot) |
Looks awesome!
|
Message boxes stuff done (with some not translated more strings...) |
e5b028a
to
82be5ce
Compare
The existing code that deals with shells is starting to rot quickly, turning into a mess that we had with difftools resolution.
I also made a change that caused the toolbar button to match the shell selection for the ConEmu. I think it fits into the mental model, but the setting location is now in the "wtf?" territory. So I'm somewhat conflicted on this change. We can revert it, if you don't think it is worthwhile change. Tests are TBD, happy to help (I had only so much time). |
Something I didn't get to, but would be good to have - make |
@pmiossec I'd like to take this into 3.4.2. I have rebased the branch (+1 commit) on to release/3.4 but I was reluctant to push it into your fork. You can see it here - https://github.com/RussKie/gitextensions/tree/launch_shell_consoles |
Tested. It seems to work well. Not reviewed because there are a lot of changes and I have to take the time to understand it.
Go if that's the way forward ;) |
ee87f14
to
e3c0ed4
Compare
Fair point. I have also initially changed how the toolbar item was bound to the same shell selected by a user as a ConEmu default shell. But in the last commit e3c0ed4 I've undone that, as it didn't feel completely coherent with the rest of the change.
I tried to account for a fact that a user may not have all shells available, and only bind shells that user had. |
81bde4e
to
14690b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RussKie Some discussions ;)
@@ -1505,9 +1505,6 @@ private void RunCommandBasedOnArgument(IReadOnlyList<string> args, IReadOnlyDict | |||
case "formatpatch": | |||
StartFormatPatchDialog(); | |||
return; | |||
case "gitbash": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You removed a feature from the command line.
Please confirm that it is on purpose because I admit that it should not be often used.
If yes, we have to remove the help line in FormCommandlineHelp.resx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I did remove it, as I removed GitModule.RunBash()
in 14690b0 as it duplicates the functionality of running bash that we have in FormBrowse
in a way that is excessive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. So I pushed the fixup...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got why you removed GitModule.RunBash
, @RussKie. But dropping a CLI in this PR feels like a submarine.
It breaks the usecase: bash
and e.g. grep
not in the PATH
, but gitex.cmd
in the PATH
.
So gitex gitbash
should open a bash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mulled over it, and you're probably right - it's a "dot" release, and this could be a breaking behaviour... we can drop 14690b0 from this PR, but I intent do it in the master.
It breaks the usecase:
bash
and e.g.grep
not in thePATH
, butgitex.cmd
in thePATH
.
Sogitex gitbash
should open a bash.
If bash is not in the path, then we can't open it. Trying to open bash via the app feels wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removal of the CLI command "gitbash" must be mentioned in the change log.
GitUI/Shells/ShellProvider.cs
Outdated
return CmdShellInstance ?? (CmdShellInstance = new CmdShell()); | ||
|
||
case "bash": | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A shellType
not found is transformed in a git-bash
. Strange...
GitUI/Shells/ShellProvider.cs
Outdated
|
||
public IShellDescriptor GetShell(string shellType) | ||
{ | ||
switch (shellType.ToLowerInvariant()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sold by the introduction of `ShellType' that:
- seems redundant with names
- makes (a little) more difficult to add a new shell because you should update 2 places (ShellType and here) and there is no help for the developer if there is a mismatch
The only advantage is to be able to so ShellType.Bash
but for this special case, a const
could be used.
I will push a commit with a draft in another branch https://github.com/pmiossec/gitextensions/tree/refactor_shells
Please, have a look....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea with the enum was to convert the setting to the enum. But your version offers probably equally good alternative.
I left a comment there.
Given there are few unresolved and outstanding issues, I'm not going to include this into 3.4.2. On the surface it looked to me as something relatively simple, but few changes may be breaking, thus not fit for a dot release. |
@@ -1505,9 +1505,6 @@ private void RunCommandBasedOnArgument(IReadOnlyList<string> args, IReadOnlyDict | |||
case "formatpatch": | |||
StartFormatPatchDialog(); | |||
return; | |||
case "gitbash": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removal of the CLI command "gitbash" must be mentioned in the change log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I prepare a commit with my requested changes to MessageBoxes
, @pmiossec?
Yes, it would be great! |
cc73a04
to
1062b46
Compare
Squash and merge at will |
and - Fix some MessageBox translations - Refactor shell type system * Break out each shell into own type that defines shell-specific defintions and settings * Refactor and rework FormBrowse and settings screen to use the new shell definitions * Rework how ConEmu terminal changes folders * Refactor how shells are intialised: Remove Lazy construct, as shells are initialised and iterated over when FormBrowse is loaded anyway. Co-authored-by: RussKie <russkie@gmail.com>
269fb09
to
991f372
Compare
@msftbot merge in 1 day |
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:
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". |
991f372
to
4b3609f
Compare
Fixes #6460
Proposed changes
Screenshots
Before
After
Test methodology
Test environment(s)