Created
October 18, 2021 13:20
-
-
Save fredericlepied/f17539857cefde94c4006f99db558540 to your computer and use it in GitHub Desktop.
This file contains 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 | |
changeid="$(git log -1|sed -n -e 's/^\s*Change-Id: //p')" | |
if [ -z "$changeid" ]; then | |
echo "Unable to find Change-Id in the commit message. Aborting." 1>&2 | |
exit 1 | |
fi | |
branch="$(git branch --show-current)" | |
if [[ "$branch" =~ master|devel|main ]]; then | |
echo "Ignoring current branch (main)." 1>&2 | |
set -x | |
git review -d "$changeid" | |
else | |
set -x | |
git review -d "$changeid" "$branch" | |
fi | |
# git-update-review ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment