Skip to content

Instantly share code, notes, and snippets.

@0cjs
Created September 5, 2017 06:06
Show Gist options
  • Save 0cjs/a3b9d7d1a5edaecb30961dfa7fb41145 to your computer and use it in GitHub Desktop.
Save 0cjs/a3b9d7d1a5edaecb30961dfa7fb41145 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# describe-pr - print a Pull Request description
#
type xsel >/dev/null 2>&1 || {
echo 1>&2 "$(basename $0): xsel command not found; please install it."
exit 1
}
# (This doesn't currently work on a Mac, where we'd use the `pbpaste`
# tool, which is the equivalant of `xsel --clipboard --input`.)
[ -z "$1" ] && {
echo 1>&2 "Usage: $(basename $0) <start-commit>"
exit 2
}
start_commit="$1"; shift
git log --reverse --pretty=format:'* %s%n%n%b' $start_commit^..HEAD \
| xsel --input --clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment