Skip to content

Instantly share code, notes, and snippets.

View peff's full-sized avatar

Jeff King peff

View GitHub Profile
@peff
peff / last-used.sh
Created February 11, 2011 22:00
find the last commit that touched a file
#!/bin/sh
commit=HEAD
pathspec=
git log --format='%H%n %s' --name-status --no-merges --no-renames $commit -- $pathspec |
perl -e '
while(<>) {
if (/^[0-9a-f]{40}$/) {
$sha1 = $&;
@peff
peff / test
Created August 13, 2010 14:44
#!/bin/sh
# Create a repo with non-linear history.
rm -rf repo
commit() {
echo "$2" >>$1 && git add $1 && git commit -m "$1: $2"
}
push() {