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

Serialise scripts #10866

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

RussKie
Copy link
Member

@RussKie RussKie commented Apr 10, 2023

Proposed changes

  • Rename API RepoDistSettings -> DistributedSettings, RepoDistSettingsPage -> DistributedSettingsPage
  • Allow to distribute user scripts

Screenshots

Before

image

After

image
image

Test methodology

  • TBD

Merge strategy

Don't squash


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

@ghost ghost assigned RussKie Apr 10, 2023
@RussKie
Copy link
Member Author

RussKie commented Apr 10, 2023

Reviving an old changeset. I had a quick test, and it seems to work.
@gerhardol @mstv @pmiossec if you could take it for a spin, it'd be great.

@vbjay
Copy link
Contributor

vbjay commented Apr 11, 2023

Recommend guid ids for unique scripts so if same script on multiple layers can get closest to repo setting instead of getting duplicates and instead of using numbers that can colide as different scripts entirely. My 112 global level may be overridden in x repo distributed because number is 112.

If we have a move/copy script around functionality to different layers so a global script has same guid as a distributed in repo then the distributed would win but it would just show 1 script row for the script per level it exists in. Basically overridable scripts.

<AskConfirmation>false</AskConfirmation>
<RunInBackground>true</RunInBackground>
<IsPowerShell>false</IsPowerShell>
<HotkeyCommandIdentifier>10001</HotkeyCommandIdentifier>
Copy link
Member

Choose a reason for hiding this comment

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

I guess we need to create unique numbers - at least per category - because all hotkeys have global scope and one cannot know which ids have already been used for repo-specific scripts of another repo.

Copy link
Contributor

@vbjay vbjay Apr 13, 2023

Choose a reason for hiding this comment

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

Numbers are a BAD idea especially since you have settings levels and across clones of repos. Instead guids should be the new IDs of the scripts. Hotkeys should not be stored across clones. Local and global would make sense. Across repos you will have potential collisions between global and local on different computers.

@mstv
Copy link
Member

mstv commented Apr 13, 2023

One needs to select the Scripts settings page once in order to be able to save other settings.
Otherwise:

  • Git Extensions 33.33.33
  • Build f996428
  • Git 2.39.2.windows.1 (recommended: 2.40.0 or later)
  • Microsoft Windows NT 10.0.19045.0
  • .NET 6.0.15
  • DPI 96dpi (no scaling)
System.NullReferenceException: Object reference not set to an instance of an object.
   at GitUI.Script.DistributedScriptsManager.Update(ScriptInfo script) in D:\Build\gitextensions3\GitUI\Script\DistributedScriptsManager.cs:line 177
   at GitUI.CommandsDialogs.SettingsDialog.Pages.ScriptsSettingsPage.PageToSettings() in D:\Build\gitextensions3\GitUI\CommandsDialogs\SettingsDialog\Pages\ScriptsSettingsPage.cs:line 184
   at GitUI.CommandsDialogs.SettingsDialog.SettingsPageBase.SaveSettings() in D:\Build\gitextensions3\GitUI\CommandsDialogs\SettingsDialog\SettingsPageBase.cs:line 99
   at GitUI.CommandsDialogs.FormSettings.Save() in D:\Build\gitextensions3\GitUI\CommandsDialogs\FormSettings.cs:line 236
   at GitUI.CommandsDialogs.FormSettings.Ok_Click(Object sender, EventArgs e) in D:\Build\gitextensions3\GitUI\CommandsDialogs\FormSettings.cs:line 303
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

@mstv
Copy link
Member

mstv commented Apr 13, 2023

The icon combobox dropdown should be filled only once, i.e. if empty.

@RussKie
Copy link
Member Author

RussKie commented Apr 13, 2023 via email

@mstv
Copy link
Member

mstv commented Apr 26, 2023

The sequence of the scripts is not correctly stored or restored.

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants