commit-msg: Do not add Change-Id to temp commits
Temporary commits that are created using "git commit --fixup" or "git commit --squash" are not supposed to be pushed to gerrit. Prevent pushing them by mistake, at least for project that require Change-Id. Change-Id: I9ac25b7384a128fea376a357f2b324b286622e2c
This commit is contained in:
		| @@ -38,6 +38,12 @@ add_ChangeId() { | ||||
| 		return | ||||
| 	fi | ||||
|  | ||||
| 	# Do not add Change-Id to temp commits | ||||
| 	if echo "$clean_message" | head -1 | grep -q '^\(fixup\|squash\)!' | ||||
| 	then | ||||
| 		return | ||||
| 	fi | ||||
|  | ||||
| 	if test "false" = "`git config --bool --get gerrit.createChangeId`" | ||||
| 	then | ||||
| 		return | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Orgad Shaneh
					Orgad Shaneh