Register gitty:// protocol on Windows and prefill Clone dialog from links #64
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
state: Done
state: New
state: To Do
type: Bug
type: Feature
type: Task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Christoph/Gitty!64
Loading…
Reference in a new issue
No description provided.
Delete branch "installer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change adds support for a gitty:// URL protocol on Windows and makes Gitty accept such links to prefill the Clone repository dialog. It also updates the installer to register the protocol and updates the app and startup logic to parse and safely handle incoming protocol links.
Key behavior changes
Installer (NSIS): the Windows installer now registers a per-user URL protocol handler at
HKCU\Software\Classes\gittythat runs${MAINBINARYNAME}.exe --protocol-url "%1"when agitty://link is opened. The installer addsDefaultIconandURL Protocolentries. Uninstall removes the registry key; updates keep the registration.Protocol parsing (Rust): a new
clone_request_from_urlfunction acceptsgitty://clone?url=...links and returns a StartupCloneRequest only when the URL strictly matches the expected form and the provided remote looks like an acceptable remote (HTTPS/HTTP/SSH/GIT oruser@host:path). The parser rejects malformed, control-char containing, empty, or suspicious values (e.g. file: URLs, multipleurlparams, flags like--upload-pack, or embedded target/destination). Browser links are explicitly treated as prefill-only: they set the remote URL but do not set a destination or trigger a clone. CLI handling now recognizes--protocol-urlandgitty:-prefixed args to create a startup clone request. Repository path parsing (repository_path_from_args) ignores protocol URLs so they will not be interpreted as local destinations.UI (Svelte): the app opens the Clone dialog prefilled when the startup clone request lacks a parent/destination.
CloneRepositoryDialoggains aninitialRemoteUrlprop and uses it to set theremoteUrlfield and select the URL source.Documentation:
README.mdincludes a short section documenting a Forgejo link template (Gitty = gitty://clone?url={url}) and usage notes (URL-encode the repo URL; browser may prompt to open the app; uninstall removes the registration; updates preserve it).Tests
startup_repository_teststo verify that:gitty://clone?url=...links prefill the dialog without supplying a local destination or starting a clone.gitty://links are rejected and cannot be interpreted as local paths or CLI clone requests.No test execution results were provided.
Recommended checks for reviewers
HKCU\Software\Classes\gittyis created with the expected command and icon entries, and that the uninstaller removes the key. Confirm installer updates do not remove the registration.gitty://clone?url=<encoded-remote>link and open it from a browser; confirm Gitty opens (or is focused) and the Clone dialog appears with the remote URL filled but no destination selected and no clone started.--protocol-url <url>or starting the app with agitty:...argument leads to a startup request being parsed, but the app still requires an explicit destination to perform a clone.Compatibility and risk notes
If you want, I can add a short manual QA checklist or a focused integration test plan to exercise the installer+protocol registration end-to-end.