Jonathan "Duke" Leto
14 years ago
16 changed files with 165 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
#!/bin/sh |
|||
|
|||
CHANGELOG=`ls | egrep 'change|history' -i` |
|||
DATE=`date +'%Y-%m-%d'` |
|||
HEAD="\nn.n.n / $DATE \n==================\n" |
|||
|
|||
if test "$1" = "--list"; then |
|||
version=`git tag | tail -n 1` |
|||
if test -z "$version"; then |
|||
git log --pretty="format: * %s" |
|||
else |
|||
git log --pretty="format: * %s" $version.. |
|||
fi |
|||
else |
|||
tmp="/tmp/changelog" |
|||
echo $HEAD > $tmp |
|||
git-changelog --list >> $tmp |
|||
echo '' >> $tmp |
|||
cat $CHANGELOG >> $tmp |
|||
mv $tmp $CHANGELOG |
|||
test -n "$EDITOR" && $EDITOR $CHANGELOG |
|||
fi |
@ -0,0 +1,6 @@ |
|||
#!/bin/sh |
|||
|
|||
SINCE="last week" |
|||
test $# -ne 0 && SINCE=$@ |
|||
echo "... commits since $SINCE" >&2 |
|||
git log --pretty='%an - %s' --after="@{$SINCE}" |
@ -0,0 +1,10 @@ |
|||
#!/bin/sh |
|||
|
|||
user="$1" |
|||
if test -z "$user"; then |
|||
echo "user name required." && exit 1 |
|||
else |
|||
count=`git log --oneline --pretty="format: %an" | grep "$user" | wc -l` |
|||
test $count -eq 0 && echo "$user did not contribute." && exit 1 |
|||
git shortlog | grep "$user (" -A $count |
|||
fi |
@ -0,0 +1,8 @@ |
|||
#!/bin/sh |
|||
|
|||
if test "$1" = "--all"; then |
|||
git shortlog -n $@ | grep "):" | sed 's|:||' |
|||
echo |
|||
fi |
|||
|
|||
echo total `git log --oneline | wc -l` |
@ -0,0 +1,4 @@ |
|||
#!/bin/sh |
|||
|
|||
test -z $1 && echo "branch required." && exit 1 |
|||
git branch -d $@ && git push origin :$1 |
@ -0,0 +1,4 @@ |
|||
#!/bin/sh |
|||
|
|||
test -z $1 && echo "tag required." && exit 1 |
|||
git tag -d $1 && git push origin :refs/tags/$1 |
@ -0,0 +1,2 @@ |
|||
#!/bin/sh |
|||
echo "0.0.3" |
@ -0,0 +1,6 @@ |
|||
#!/bin/sh |
|||
|
|||
test -z $1 && echo "branch required." && exit 1 |
|||
git symbolic-ref HEAD refs/heads/$1 |
|||
rm .git/index |
|||
git clean -fdx |
@ -0,0 +1,9 @@ |
|||
#!/bin/sh |
|||
|
|||
test -z $1 && echo "source branch required." && exit 1 |
|||
src=$1 |
|||
dst=${2-master} |
|||
|
|||
git checkout $dst \ |
|||
&& git merge --no-ff $src \ |
|||
&& git branch -d $src |
@ -0,0 +1,10 @@ |
|||
#!/bin/sh |
|||
|
|||
if test $# -eq 0; then |
|||
echo "arguments required" && exit 1 |
|||
else |
|||
for pattern in $@; do |
|||
echo $pattern >> .gitignore |
|||
echo "... added '$pattern'" |
|||
done |
|||
fi |
@ -0,0 +1,12 @@ |
|||
#!/bin/sh |
|||
|
|||
if test $# -gt 0; then |
|||
echo "... releasing $1" |
|||
git commit -a -m "Release $1" \ |
|||
&& git tag "$1" \ |
|||
&& git push \ |
|||
&& git push --tags \ |
|||
&& echo "... complete" |
|||
else |
|||
echo "tag required" && exit 1 |
|||
fi |
@ -0,0 +1,24 @@ |
|||
#!/bin/sh |
|||
|
|||
while true; do |
|||
# Readline |
|||
read -r -p "git> " cmd |
|||
|
|||
# EOF |
|||
test $? -ne 0 && break |
|||
|
|||
# History |
|||
history -s "$cmd" |
|||
|
|||
# Built-in commands |
|||
case $cmd in |
|||
quit) |
|||
break |
|||
;; |
|||
esac |
|||
|
|||
# Execute |
|||
git $cmd |
|||
done |
|||
|
|||
echo |
@ -0,0 +1,6 @@ |
|||
#!/bin/sh |
|||
|
|||
test -z "$1" && echo "path required." && exit 1 |
|||
cd "$1" |
|||
test -d .git && exit |
|||
git init && git add . && git commit -m 'Initial commit' |
@ -0,0 +1,18 @@ |
|||
#!/bin/sh |
|||
|
|||
COMMITISH="" |
|||
test $# -ne 0 && COMMITISH=$@ |
|||
project=${PWD##*/} |
|||
commit_count=`git log --oneline $COMMITISH | wc -l | tr -d ' '` |
|||
file_count=`git ls-files | wc -l | tr -d ' '` |
|||
authors=`git shortlog -n -s $COMMITISH` |
|||
|
|||
echo |
|||
echo " project: $project" |
|||
echo " commits: $commit_count" |
|||
if test "$COMMITISH" = ""; then |
|||
echo " files : $file_count" |
|||
fi |
|||
echo " authors: " |
|||
echo "$authors" |
|||
echo |
@ -0,0 +1,11 @@ |
|||
#!/bin/sh |
|||
|
|||
if test $# -eq 0; then |
|||
git reset --hard HEAD~1 |
|||
else |
|||
if `echo $1 | grep -q [^[:digit:]]`; then |
|||
echo $1 is not a number |
|||
else |
|||
git reset --hard HEAD~$1 |
|||
fi |
|||
fi |
@ -0,0 +1,13 @@ |
|||
#!/bin/sh |
|||
|
|||
orig=$PWD |
|||
version=`git extras-version` |
|||
|
|||
cd /tmp \ |
|||
&& rm -fr ./git-extras \ |
|||
&& git clone http://github.com/visionmedia/git-extras.git \ |
|||
&& cd git-extras \ |
|||
&& make install \ |
|||
&& cd $orig \ |
|||
&& echo "... updated to git-extras $version" |
|||
|
Loading…
Reference in new issue