Code Monkey home page Code Monkey logo

Comments (11)

kb-1000 avatar kb-1000 commented on August 27, 2024

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

from mgit.

maks avatar maks commented on August 27, 2024

Actually this is fairly straight forward as:

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

would be a good enough heurtistic

from mgit.

maks avatar maks commented on August 27, 2024

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.

from mgit.

kb-1000 avatar kb-1000 commented on August 27, 2024

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

from mgit.

maks avatar maks commented on August 27, 2024

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

from mgit.

kb-1000 avatar kb-1000 commented on August 27, 2024

@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.

from mgit.

maks avatar maks commented on August 27, 2024

@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.

from mgit.

kb-1000 avatar kb-1000 commented on August 27, 2024

@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)

from mgit.

maks avatar maks commented on August 27, 2024

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.

from mgit.

kb-1000 avatar kb-1000 commented on August 27, 2024

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

from mgit.

maks avatar maks commented on August 27, 2024

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.

from mgit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.