soypat / gitaligned

Find out where you fall on the Open-Source Character Alignment Chart
MIT License
74 stars 3 forks source link

Crawl into directories to find multiple repositories #4

Open creedasaurus opened 3 years ago

creedasaurus commented 3 years ago

First off, this is awesome. Thank you for making the internet a better place by creating this fun tool. It made my day.

Just as an idea, what if we could have this take a directory, and then upon not finding a .git repo, crawl into the child directories and collect commits from any it finds and analyze them together. Just thinking about that since our teams are often working across many repos. Just a thought.

If I have some time this week, maybe I'll take a crack at it.

😁

soypat commented 3 years ago

Sounds great! Keep in mind you should be running prose.NewDocument once since it has an extremely high overhead. This just means you'll probably have to accumulate commits on each repo before finally processing using prose.

alephnull commented 3 years ago

This is well within the capabilities of the shell. To look at all *.git dirs (bare repos):

for i in *.git
do
    cd $i
    gitaligned --json | jq --arg repo ${i:r} '.[] | .+{repo: $repo}'
    cd -q -
done | jq -s

Gives you an array with each record also containing the repo name.