Skip to content

Instantly share code, notes, and snippets.

@kswedberg
Created December 2, 2012 18:41
Show Gist options
  • Save kswedberg/4190376 to your computer and use it in GitHub Desktop.
Save kswedberg/4190376 to your computer and use it in GitHub Desktop.
commit pull request
cipreq() {
if [ -z "$1" ]
then
echo `git log -1 --no-merges --pretty=format:'git commit -a --author="'"%an <%aE>"'" --message="'"%s %b"'"'`
return 1
fi
AUTHOR=$1
if [ -z "$2" ]
then
MSG=""
else
MSG="--grep=${2}"
fi
echo `git log -1 ${MSG} --author="${AUTHOR}" --no-merges --pretty=format:'git commit -a --author="'"%an <%aE>"'" --message="'"%s %b"'"'`
}
@kswedberg
Copy link
Author

If the author committed again after sending the pull request and that other commit was merged in, you can specify a distinctive word within the commit message that you're targeting. It would look like this:

cipreq Karl somethingFromCommit

This is starting to feel hackish. I wish I knew how to do command-line arguments of the -- variety so we could do something like cipreq --author=Karl --msg=somethingFromCommit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment