[Small Feature] Is there a way to decide path where the Git repositories will be cloned?
xiao623 opened this issue · comments
grimoirelab-perceval/perceval/backends/core/git.py
Lines 336 to 348 in 4a65ece
The git_path
would decide path where the Git repository will be cloned, but it just only for one repo
.
If I have many repos, I must change git_path one by one and run the program again and agian.
Yes, I can use ~/.perceval/repositories/
for those repos and clone them, but sometimes I want to change the place where those repos have been cloned in advance. For example, those repos would be cloned in special place (e.g. my NAS) instead of local server's path.
[New Feature & Small Feature]
I think we can add a param repo-path
for Git Perceval Backend
so that we can decide path where the Git repositories will be cloned.
def _pre_init(self):
...
elif self.parsed_args.repo_path:
base_path = self.parsed_args.repo_path
processed_uri = self.parsed_args.uri.lstrip('/')
git_path = os.path.join(base_path, processed_uri) + '-git'
elif not self.parsed_args.git_path:
...
def setup_cmd_parser(cls):
...
exgroup.add_argument('--repo-path', dest='repo_path',
help="Path where the Git repositories will be cloned")
exgroup.add_argument('--git-path', dest='git_path',
...
Sounds good. Can you open a PR with this feature? I would like to have a better name for the option than repo-path
if possible.