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

Directory with many Git repositories isn't recognized #327

Open
BeeGrech opened this issue Sep 25, 2023 · 1 comment
Open

Directory with many Git repositories isn't recognized #327

BeeGrech opened this issue Sep 25, 2023 · 1 comment

Comments

@BeeGrech
Copy link

I have configured a directory wild card which holds many git repositories. When using the wildcard on a higher level i get no commits back in my report. However drilling down in that same structure starts to yield results.
I'm not sure of the exact number but I have configured many repos under a higher directory here

Example:

/home/myuser/workdir/*
No commits recived

/home/myuser/workdir/proj/fork
will yield my commits

@psss
Copy link
Owner

psss commented Nov 8, 2023

Yes, the currently wildcard implementation is very simple:

did/did/plugins/git.py

Lines 126 to 146 in f153b58

if path.endswith('/*'):
try:
directories = os.listdir(path[:-1])
except OSError as error:
log.error(error)
raise did.base.ConfigError(
"Invalid path in the [{0}] section".format(option))
for repo_dir in sorted(directories):
repo_path = path.replace('*', repo_dir)
# Check directories only
if not os.path.isdir(repo_path):
continue
# Silently ignore non-git directories
if not os.path.exists(os.path.join(repo_path, ".git")):
log.debug("Skipping non-git directory '{0}'.".format(
repo_path))
continue
self.stats.append(GitCommits(
option="{0}-{1}".format(repo, repo_dir),
parent=self, path=repo_path,
name="Work on {0}/{1}".format(repo, repo_dir)))

We could possibly extend it to explore deeper directory structure as well.

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