-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
2,737 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
#!/bin/sh | |||
|
|||
git add -A | |||
git ls-files --deleted -z | xargs -0 git rm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
#!/bin/sh | |||
|
|||
find .git/objects -type f | \ | |||
while read file; do | |||
if echo $file | egrep -q '\.idx$'; then | |||
git show-index < $file | awk '{print $2}' | |||
elif echo $file | egrep -q '[0-9a-f]{38}$'; then | |||
echo $(basename $(dirname $file))$(basename $file) | |||
fi | |||
done | \ | |||
while read hash; do | |||
if [ "$(git cat-file -t $hash)" = commit ]; then | |||
echo $hash | |||
fi | |||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
#!/bin/bash | |||
|
|||
git clean -f -x -d | |||
git checkout $1 | |||
|
|||
rm -fr /usr/local/stow/git-$1 | |||
|
|||
make prefix=/usr/local/stow/git-$1 -j3 install | |||
|
|||
git checkout origin/man | |||
|
|||
rsync -av man1/ /usr/local/stow/git-$1/share/man/man1/ | |||
rsync -av man5/ /usr/local/stow/git-$1/share/man/man5/ | |||
rsync -av man7/ /usr/local/stow/git-$1/share/man/man7/ | |||
|
|||
git clean -f -x -d | |||
git checkout master | |||
chown -R johnw . | |||
|
|||
git reset --hard HEAD | |||
git merge origin/master | |||
|
|||
cd /usr/local/stow | |||
stow -D git-* | |||
|
|||
stow git-$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,79 @@ | |||
#!/usr/bin/env python | |||
|
|||
# git-changelog | |||
# | |||
# version 1.0, by John Wiegley | |||
# | |||
# The purpose of this code is to turn "git log" output into a complete | |||
# ChangeLog, for projects who wish to begin using a ChangeLog, but haven't | |||
# been. | |||
|
|||
import datetime | |||
import string | |||
import sys | |||
import re | |||
|
|||
from subprocess import * | |||
|
|||
p = Popen("git log --stat %s" % string.join(sys.argv[1:], " "), | |||
shell = True, stdout = PIPE).stdout | |||
|
|||
line = p.readline() | |||
while line: | |||
match = re.match("commit ([0-9a-f]+)", line) | |||
assert match | |||
hash_id = match.group(1) | |||
|
|||
line = p.readline() | |||
|
|||
match = re.match("Author: (.+)", line) | |||
assert match | |||
author = match.group(1) | |||
author = re.sub(" <", " <", author) | |||
|
|||
line = p.readline() | |||
|
|||
match = re.match("Date: +(.+?) [-+][0-9]{4}", line) | |||
assert match | |||
# Tue Sep 30 05:43:49 2003 +0000 | |||
date = datetime.datetime.strptime(match.group(1), '%a %b %d %H:%M:%S %Y') | |||
|
|||
line = p.readline() # absorb separator | |||
line = p.readline() | |||
|
|||
log_text = "" | |||
while line and line != '\n': | |||
if not log_text: | |||
log_text += line[4:] | |||
else: | |||
log_text += "\t" + line[4:] | |||
|
|||
line = p.readline() | |||
|
|||
line = p.readline() | |||
|
|||
files = [] | |||
while line and line != '\n': | |||
match = re.match(" (.+?) +\\|", line) | |||
if match: | |||
files.append(match.group(1)) | |||
line = p.readline() | |||
else: | |||
break | |||
|
|||
line = p.readline() | |||
|
|||
fp = Popen("fmt", shell = True, stdin = PIPE, stdout = PIPE) | |||
|
|||
fp.stdin.write("\t* %s: %s\n" % (string.join(files, ",\n\t"), log_text)) | |||
fp.stdin.close() | |||
log_text = fp.stdout.read() | |||
|
|||
del fp | |||
|
|||
print "%s %s\n\n%s\t* commit %s\n" % \ | |||
(date.strftime("%Y-%m-%d"), author, log_text, hash_id) | |||
|
|||
line = p.readline() | |||
|
|||
# git-changelog ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,10 @@ | |||
#!/bin/bash | |||
|
|||
commit=$1 | |||
branch=$2 | |||
if [[ -z "$branch" ]]; then | |||
branch=HEAD | |||
fi | |||
|
|||
git rev-list --children $branch --not $commit^@ | \ | |||
awk "/^$commit/ { print \$2 }" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
#!/bin/bash | |||
|
|||
if [[ -z "$1" ]]; then | |||
ancestor=master | |||
else | |||
ancestor=$1 | |||
shift 1 | |||
fi | |||
current="$ancestor" | |||
|
|||
ancestor=$(git rev-parse $ancestor) | |||
|
|||
for head in $(git rev-parse --branches); do | |||
if [[ $head != $ancestor ]]; then | |||
if git rev-list -30 $head | grep -q $ancestor; then | |||
current="$current $(git describe --all --abbrev=0 $head | sed 's/heads\///')" | |||
fi | |||
fi | |||
done | |||
|
|||
git show-branch $current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
#!/bin/bash | |||
|
|||
stat=true | |||
if [[ "$1" == "-p" ]]; then | |||
stat=false | |||
shift 1 | |||
fi | |||
|
|||
HERE=$(pwd) | |||
|
|||
(cd "$1" && git --git-dir=$HERE/.git diff ${2:-HEAD}) | \ | |||
if [[ $stat == true ]]; then \ | |||
diffstat | grep -v only$; \ | |||
else \ | |||
cat; \ | |||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
#!/bin/sh | |||
|
|||
git stash | |||
git symbolic-ref HEAD refs/heads/$1 | |||
rm .git/index | |||
git clean -f -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
#!/bin/sh | |||
git reflog expire --expire=0 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
#!/bin/sh | |||
|
|||
[ $# -eq 7 ] && emacsclient --eval "(ediff \"$2\" \"$PWD/$5\")" |
Oops, something went wrong.