Skip to content

Commit

Permalink
Make errors red (#4)
Browse files Browse the repository at this point in the history
## Summary:
More obvious so people don't go committing on master

Issue: XXX-XXXX

## Test plan:
Run `git rb <name>` off of master, see it more obvious

Author: lillialexis

Reviewers: Chalayyy

Required Reviewers:

Approved By: Chalayyy

Checks:

Pull Request URL: #4
  • Loading branch information
lillialexis authored Nov 13, 2024
1 parent 41911e2 commit b459800
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/git-review-branch
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ elif [ -n "`git config --get branch.review-parent-default`" ]; then
git co "`git config --get branch.review-parent-default`"
fi
RED='\033[0;31m'
NC='\033[0m' # No Color
# Stop people from landing directly to master
# TODO(benkraft): After ka-clone has been setting kaclone.protect-master
# for a while (2020 should be safe), remove the first half of the || as
# it should be redundant (and it's kinda hacky).
if git remote -v | grep -q Khan/webapp || git config kaclone.protect-master | grep -q true; then
if [ "`git rev-parse --abbrev-ref HEAD`" = "master" ]; then
echo "Review branches must not be based off master";
echo "${RED}FATAL ERROR: Review branches must not be based off master${NC}";
exit 1
fi
fi
Expand Down

0 comments on commit b459800

Please sign in to comment.