fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
465 stars 10 forks source link

Clone into subdirectory based on host #292

Open hypervtechnics opened 5 years ago

hypervtechnics commented 5 years ago

Make it possible to clone into a subdirectory. The directory should be based on the host of the clone URI and also change the author accordingly.

DanPristupov commented 5 years ago

Could you elaborate?

Do you want Fork to propose a subdirectory (for example c:\source\github.com\reponame?

hypervtechnics commented 5 years ago

You said it. 😄 Profiles could be used to leverage this.

Assume the following: Cloning repository from: https://git.example.com/auser/arepository.git Storing all repositories in: C:\Repositories\ Fork should propose: C:\Repositories\git.example.com\auser\arepository\

This can be either done via RegEx (as e.g. Azure DevOps has some kind of ugly urls) or by just extracting the last two path segments.

Profiles may contain some additional information as aliases: Profile 1: Clone Host: git.example.com Author information: Me <me@example.com> Path for repositories: git.example.com\ (appended to the base path defined in the already existing option) Detect user: Yes Extraction method: RegEx/Url

Profiles would also make it easier to switch the author in other repositories by just proposing author information from other profiles.

Let me know if you have questions 😃

hypervtechnics commented 5 years ago

For the author part this might help maybe: https://github.com/gesquive/git-user

hypervtechnics commented 5 years ago

I just realized that this may also set things like the bug tracker rules according to the host to also provide integrations with non-popular (Gitea/Gogs) git servers without user interactions.

DanPristupov commented 5 years ago

OK, first of all I think Fork should not propose a default subfolder on clone.

  1. It's up to user how to manage the repository folder structure. Everybody has an own opinion and doesn't need a rule or my recommendation.
  2. It doesn't make much sense. Personally I don't see a point in keeping majority of my repos (about 80) in the 'github.com' subfolder.

Regarding the bug tracker integration.

I believe, 99% of gitlab/gitea/gogs/bitbucket users use third party issue trackers (Jira, Redmine, YouTrack, etc). Creating rules according to host names doesn't make much sense there. It might happen that I didn't understand the proposal correctly, in this case I need more details.

hypervtechnics commented 5 years ago

According to this: https://riptutorial.com/git/example/31016/multiple-usernames-and-email-address

The feature was partly implemented in Git. A cool UI for this would be nice but definitly no must. Just wanted to drop it here in case someone/you (@DanPristupov) is still interested in this... :)

What role would Fork play? Provide UI to edit the mapping user <=> folder and suggest a path based on the clone URL. (Simple RegEx would suffice)

Another source: https://stackoverflow.com/questions/4220416/can-i-specify-multiple-users-for-myself-in-gitconfig

Especially private/work scenarios would profit from this.

DanPristupov commented 5 years ago

Thank you. I didn't know about that feature.

I'm not sure how Fork might configure that without confusion, but I will think about that.

P.S. Sorry, might have closed the issue accidentally

ecca commented 4 years ago

@DanPristupov Adding profiles would make sense in such way as GitKraken does it, where you could create profiles that support different ssh keys and username/email for current context.

image