gitaligned icon indicating copy to clipboard operation
gitaligned copied to clipboard

Crawl into directories to find multiple repositories

Open creedasaurus opened this issue 4 years ago • 2 comments

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.

😁

creedasaurus avatar Apr 05 '21 21:04 creedasaurus

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.

soypat avatar Apr 05 '21 23:04 soypat

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.

alephnull avatar Apr 16 '21 16:04 alephnull