Gautier / bitbucket-sync

bitbucket-sync synchronize locally all the repositories of a bitbucket account
MIT License
12 stars 6 forks source link

repo dir shall include owner name, not only slug #3

Closed vlcinsky closed 10 years ago

vlcinsky commented 10 years ago

One may have access to repositories from multiple accounts: it's own, team ones, and those who are shared with him.

When using workflow "form my repo and then issue pull request" one gets often repositories with the same name living under different owners.

Currently, repositories are stored locally in directory, which is derived only from slug. This may result in conflicts, as multiple repositories may attempt to sync into the same local directory.

Proposal 1: repo directories as subdirs of owner directory

so for repo named "repo" existing in different versions at account "vlcinsky" and "myteam", sync would result in "vlcinsky/repo.git" and "myteam/repo.git".

This is safe method, but sometime it may archive repos from other owners, what is not always needed.

Proposal 2: require --owner to specify, which account to sync

Note, that one account may provide repos from multiple owners so do not confuse owner with account.

The value of --owner would define filter, selecting only repos, which are owned by given owner.

In this case the owner parameter is required.

Proposal 3: combine 1 and 2

So always store under directory of an owner.

And allow filtering by one owner name (this time this does not have to be required parameter).

Gautier commented 10 years ago

I think it makes sense, I've implemented "Proposal 3".

Please open a new issue if this doesn't quite work for you.

vlcinsky commented 10 years ago

I confirm, it works. And I like how it goes.