Last active
January 24, 2019 19:29
-
-
Save paulscott/8a67b88f621985260e8a41d105958633 to your computer and use it in GitHub Desktop.
generate a very simple changelog between the current branch and it's build branch, or other named branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# gives a changelog from the last build branch to the feature branch | |
currentBranch=$(git rev-parse --abbrev-ref HEAD) | |
currentBranch=${currentBranch#"build/"} | |
buildBranch="build/${currentBranch}" | |
# if no args, $buildBranch..$currentBranch | |
# if one arg, $1..$currentBranch | |
# if twho args, $1..$2 | |
fromBranch=${1-$buildBranch} | |
toBranch=${2-$currentBranch} | |
fromType=$([ -z "${1}" ] && echo 'build branch' || echo '') | |
echo "Change log from ${fromType} ${fromBranch} to ${toBranch}:" | |
git log --pretty='format:- %s (%aN)' "${fromBranch}..${toBranch}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added a header note to the log, so we know what we're looking at.