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

Remove clone_script.tmpl or is it still required? #22364

Closed
rdwz opened this issue Jan 8, 2023 · 2 comments
Closed

Remove clone_script.tmpl or is it still required? #22364

rdwz opened this issue Jan 8, 2023 · 2 comments

Comments

@rdwz
Copy link

rdwz commented Jan 8, 2023

I came across this file and would like this to be discussed: as far as I can tell at the frontend the code seems not to be necessary, am I wrong, what about the backend-side of this?

  • there is clone_script.tmpl, but as I already mentioned all works fine without editing this and I also tested the case of an empty clone_script and it doesn't break the functionality or the generated links.
  • and the file has this comments:

// synchronously set clone button states and urls here to avoid flickering
// on page load. initRepoCloneLink calls this when proto changes.
// this applies the protocol-dependant clone url to all elements with the
// js-clone-url and js-clone-url-vsc classes.
// TODO: This localStorage setting should be moved to backend user config
// so it's available during rendering, then this inline script can be removed.

to me it seems that it can be removed, but I guess this is another issue and should be discussed seperately?!

Originally posted by @redwerkz in #21123 (comment)

@rdwz
Copy link
Author

rdwz commented Jan 8, 2023

A little more background about this.

I wanted to add a button to clone a repo in VSCodium like it is already possible to do for VSCode. And this script inside clone_script.tmpl handles or handled the link behind the button that includes a custom handle like vscode:// or vscodium://

Screenshot_20230108_053715

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 8, 2023

Can clone_script.tmpl be removed?

No at the moment.

How it works?

The Clone URLs are updated by that script. Users may:

  • Disable HTTPS clone, then only SSH URL should be used
  • Set SSH as default clone method, then the UI should show the SSH URL by default.

You can do a full test on your side to see how the Clone URL works.

@rdwz rdwz closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants