Skip to content

Instantly share code, notes, and snippets.

@fredericlepied
Created October 18, 2021 13:20
Show Gist options
  • Save fredericlepied/f17539857cefde94c4006f99db558540 to your computer and use it in GitHub Desktop.
Save fredericlepied/f17539857cefde94c4006f99db558540 to your computer and use it in GitHub Desktop.
#!/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