gitkit icon indicating copy to clipboard operation
gitkit copied to clipboard

let the user select the folder to save the repo, dont use only the url

Open Vano2903 opened this issue 4 years ago • 3 comments

it would work if I would use something like user/repo.git but if I use something like git/api/user/repo.git your code create different nested repos which is not ideal

Vano2903 avatar Dec 30 '21 23:12 Vano2903

You can turn off automatic repo creation with config.AutoCreate option. As for let the user select the folder to save the repo, im not sure what you mean. What's your use case?

sosedoff avatar Dec 31 '21 00:12 sosedoff

for as much as I understood, with your package you automatically create a repo (if config.AutoCreate is true) using the request path. i.e. let's say I have a remote at localhost/vano/vano.git, your package would create a directory "vano" inside the directory I said as default git repo and a nested one called vano.git. The thing I'd like to do is to be able to set the repo manually and not from the path of the URL because, for the case I am using your package, the URL of my remotes is /git/api/vano/vano.git (which created 4 different folders while I want just 2 (vano and (nested) vano.git)

hope you get what i mean :D

Vano2903 avatar Dec 31 '21 02:12 Vano2903

Yea turn off automatic creation of the repos then, this feature is meant for dev/test environments only.

About your other request - if you wish to have your custom URL for repos, you can use nginx to rewrite the paths before they get to the gitkit. There's no other way to rewrite repo names at this point. Here's the code responsible for mapping repo name: https://github.com/sosedoff/gitkit/blob/99577b562191e1a27b81dfb2d569ea54452d77e9/utils.go#L61 you can hack on it if you feel adventurous.

sosedoff avatar Dec 31 '21 02:12 sosedoff