Skip to content

Conversation

mstv
Copy link
Member

@mstv mstv commented May 31, 2024

Fixes #11711

Proposed changes

  • fix(ShellEx): Support adding multiple files
  • fix(ShellEx): Write InstallDir to registry on registration of the shell extension
  • fix(ShellEx): Open GE with current dir as work dir

Screenshots

Before

N/A

After

image

Test methodology

  • manual

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


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

@mstv mstv self-assigned this May 31, 2024
@mstv mstv marked this pull request as draft May 31, 2024 23:36
@mstv mstv marked this pull request as ready for review June 1, 2024 09:59
mstv added a commit to mstv/gitextensions that referenced this pull request Jun 1, 2024
on registration of the shell extension

Refs: gitextensions#11770
mstv added a commit to mstv/gitextensions that referenced this pull request Jun 1, 2024
@mstv mstv force-pushed the fix/11711_shellex_addfiles branch from f785ca8 to 3ff09aa Compare June 1, 2024 09:59
mstv added a commit to mstv/gitextensions that referenced this pull request Jun 1, 2024
mstv added a commit to mstv/gitextensions that referenced this pull request Jun 2, 2024
@mstv mstv force-pushed the fix/11711_shellex_addfiles branch 2 times, most recently from bc2754b to e2c0cd7 Compare June 2, 2024 09:50
mstv added a commit to mstv/gitextensions that referenced this pull request Jun 2, 2024
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.

+1 have not run or reviewed thoroughly, test succeeded.

public static void Register() => RunRegSvrForShellExtensionDlls("/s {0}");
public static void Register()
{
AppSettings.SetInstallDir(AppSettings.GetGitExtensionsDirectory());
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't we need the same for other invocation of RunRegSvrForShellExtensionDlls?
Wouldn't it make sense to call AppSettings.SetInstallDir in RunRegSvrForShellExtensionDlls?

Copy link
Member Author

Choose a reason for hiding this comment

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

Wouldn't it make sense to call AppSettings.SetInstallDir in RunRegSvrForShellExtensionDlls?

Not for deregistration.

Wouldn't we need the same for other invocation of RunRegSvrForShellExtensionDlls?

Deregistration is the only other caller.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense

@@ -15,13 +15,13 @@ public FormAddFiles(IGitUICommands commands, string? addFile = null)

private void ShowFilesClick(object sender, EventArgs e)
{
string arguments = string.Format("add --dry-run{0} \"{1}\"", force.Checked ? " -f" : "", Filter.Text);
string arguments = string.Format("add --dry-run{0} {1}", force.Checked ? " -f" : "", Filter.Text);
Copy link
Member

Choose a reason for hiding this comment

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

What's the value of Filter.Text? Doesn't it need to be quoted? That is Filter.Text.Quote()?

Copy link
Member Author

Choose a reason for hiding this comment

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

What's the value of Filter.Text? Doesn't it need to be quoted? That is Filter.Text.Quote()?

Command line arguments have already been quoted (refer to the screenshot in the PR description). Other callsites do not fill the textbox.
So if the user removes quotes from file names with spaces, it is their fault.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense

@RussKie
Copy link
Member

RussKie commented Jun 11, 2024

Noting that the fix has been confirmed by @asmwarrior in #11711 (comment)

@mstv mstv force-pushed the fix/11711_shellex_addfiles branch from 80612eb to eb481dd Compare June 11, 2024 22:28
@mstv mstv merged commit eb481dd into gitextensions:master Jun 11, 2024
@mstv mstv deleted the fix/11711_shellex_addfiles branch June 11, 2024 22:29
@RussKie RussKie added this to the vNext milestone Jun 23, 2024
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.

right click on the Contex menu->GetExt Add files, and nothing happens
3 participants