Skip to content

Instantly share code, notes, and snippets.

@motemen
Created November 8, 2010 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motemen/667569 to your computer and use it in GitHub Desktop.
Save motemen/667569 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ "$2$3" = "" ]; then
git ls-files --stage $(git diff --cached --name-only) | grep '^160000 ' |
while read mode sha1 stage path
do
msg=`cd $path; git --no-pager log -1 --pretty=%s`
echo "1a\n * `basename $path`: $msg\n.\nw" | ed "$1"
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment