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

SGit should scan for new repos #14

Open
maks opened this issue Nov 2, 2016 · 11 comments
Open

SGit should scan for new repos #14

maks opened this issue Nov 2, 2016 · 11 comments
Milestone

Comments

@maks
Copy link
Owner

maks commented Nov 2, 2016

From @maks on August 24, 2016 5:13

SGit should do a dir listing of the top-level repo directory, to check for new repos that have been created by a tool other than SGit (ie. they are not in SGits sqlite db) and offer to "import" them for the user.

Copied from original issue: sheimi/SGit#239

@maks maks added this to the 1.5.2 milestone Nov 8, 2016
@maks maks modified the milestones: 1.5.3, 1.5.4 Jul 20, 2017
@maks maks modified the milestones: 1.5.4, 1.5.5 Mar 18, 2018
@kb-1000
Copy link
Contributor

kb-1000 commented May 15, 2018

This is difficult if the user changes the root directory and that contains other "folders" (i.e. not git repositories)

@maks
Copy link
Owner Author

maks commented May 17, 2018

Actually this is fairly straight forward as:

gitDir(file, ".git")
file.isDirectory() && gitDir.exists() && gitDir.isDirectory()

would be a good enough heurtistic

@maks
Copy link
Owner Author

maks commented May 17, 2018

Also the plan is to no longer use sqlite in the future and just do the above as required and remove the whole concept of "importing" local repos, all we really want to do is maintain a list of paths of "recently" accessed local repos.

@kb-1000
Copy link
Contributor

kb-1000 commented May 17, 2018

@maks what's about passwords/usernames then? Putting them in remote url doesn't seem to be good practice...

@maks
Copy link
Owner Author

maks commented May 17, 2018

Credentials can be stored in secure prefs and MGit already has a dependency on that library.

@kb-1000
Copy link
Contributor

kb-1000 commented May 17, 2018

@maks two things: most Git submodules use something like this:

git: ../.git/modules/some-module

as the .git in its directory, and if you are storing the credentials there it's still bound to a database which lists repositories to map credentials to them.

@maks
Copy link
Owner Author

maks commented May 17, 2018

@kaeptmblaubaer1000 Credentials are for remotes, so they need to be mapped to them, not to specific local repos, so it doesn't matter is a local repo is a submodule or not.
This will work the same way is MGit already stores passwords for ssh keys, where it uses the name of the ssh file as the secureprefs key, see: https://github.com/maks/MGit/blob/master/app/src/main/java/me/sheimi/sgit/dialogs/EditKeyPasswordDialog.java#L79
though the new prefs keynames will be name-spaced with a prefix (eg. https_auth.*) which the current ssh password keys unfortuntately dont do.

@kb-1000
Copy link
Contributor

kb-1000 commented May 18, 2018

@maks what's if there are multiple credentials? (e.g. if one has multiple GitHub accounts or there are different servers on the same server port)

@maks
Copy link
Owner Author

maks commented May 18, 2018

A remote is a specific repo not just a service or server. If you have multiple accounts that you use with a specific remote repo then you would need to differentiate between them with different URIs.

@kb-1000
Copy link
Contributor

kb-1000 commented May 19, 2018

@maks now I know what you mean, and it sounds good, except that I would have to enter my GitHub credentials again and again.

@maks
Copy link
Owner Author

maks commented May 19, 2018

Well yes, you would need to enter your credentials each time you clone from a new remote or add a new remote to an existing local repo, but that is not something that happens very often compared other operations.

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

No branches or pull requests

2 participants