/usr/bin/git-squash is in git-extras 1.9.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #!/bin/sh
src=$1
msg=$2
test -z $src && echo "source branch required, or use --me." && exit 1
# squash current branch
# TODO: do this in a less hacky way
# TODO: less sketchy arguments
if [[ $1 == "--me" ]]; then
msg=$3
branch=`git rev-parse --abbrev-ref HEAD`
# merge against target branch or master
git checkout ${2-master}
git checkout -B squash-tmp
git squash $branch
git branch -D $branch
git checkout -B $branch
git branch -D squash-tmp
if test -n "$msg"; then
git commit -a -m "$msg"
fi
exit
fi
# squash $src
git merge --squash $src
if test -n "$msg"; then
git commit -a -m "$msg" && git branch -D $src
fi
|