Skip to content
/ git-map Public

run an arbitrary command against all git commits, or *n* evenly spaced apart commits

Notifications You must be signed in to change notification settings

6/git-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

git-map

run an arbitrary command against all commits, or n evenly-spaced commits across time.

examples

count number of files for every commit:

git-map "git ls-files | wc -l"

count lines of code for 10 evenly-spaced commits:

git-map "grep '' -IR . --exclude-dir={.git,log} | wc -l " -n 10

boot up webserver and take a screenshot for 5 evenly-spaced commits:

git-map ~/screenshot.sh -n 5
# screenshot.sh

# Reinstall dependencies as they may be different for older commits
bundle install

# Boot up the server and record the process ID (so we can kill it later)
nohup bundle exec middleman >/dev/null 2>&1&
pid=$!

# Wait for the server to finish booting, then take a screenshot
sleep 5
open "http://localhost:4567"
sleep 5
timestamp=$(date +%s)
screencapture ~/Desktop/screenshot-$timestamp.jpg

kill $pid

About

run an arbitrary command against all git commits, or *n* evenly spaced apart commits

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages