repoloop

command module
v0.0.0-...-ec1f7e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 8 Imported by: 0

README

repoloop

Loop over N git repos. At the moment this is my playground for learning go.

Imagine you have one directory containing many git repos.

You want to loop over all git repos and execute git log -G ... or similar commands in each git repo.

This code uses go-git which is a pure Golang implementation of git.

Development Install

> git clone git@github.com:guettli/repoloop.git

> cd repoloop

> go mod tidy

> go run main.go search-term path_to_directory_containing_git_repos

This code is rougly ten times slower than git

This is 10x faster:

for repo in *; do (cd $repo; echo $repo; time git log -G foo --pretty="%ad %h in $repo by %an, %s" --date=iso ) ; done | sort -r

Benchmarking

> go test -cpuprofile cpu.prof -memprofile mem.prof -bench .
> go tool pprof cpu.prof

>> top

>> web
> go tool pprof mem.prof

>> top

>> web

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL