Skip to content

Instantly share code, notes, and snippets.

@droidfivex
Created November 25, 2016 07:08
Show Gist options
  • Save droidfivex/13d72ed512b9999514842b3b63b0285f to your computer and use it in GitHub Desktop.
Save droidfivex/13d72ed512b9999514842b3b63b0285f to your computer and use it in GitHub Desktop.

AUTOMATION SET COMMIT MSG / AUTHOR

sample: zhao's Remove enhanced NFC feature commit.

function zhao () {
	git add --all
	device=$(pwd | sed "s/.*_//g")
	echo -e "$device: Remove enhanced NFC feature\n\nThis is no longer used anywhere.\n\nChange-Id: Iaabfaec2d7c734b5f286f3dc4ef651d93b2f2bc8" > .git/COMMIT_EDITMSG
	git commit --author="Zhao Wei Liew <[email protected]>" -F .git/COMMIT_EDITMSG
};

oneline:

function zhao () { git add --all; device=$(pwd | sed "s/.*_//g"); echo -e "$device: Remove enhanced NFC feature\n\nThis is no longer used anywhere.\n\nChange-Id: Iaabfaec2d7c734b5f286f3dc4ef651d93b2f2bc8" > .git/COMMIT_EDITMSG ; git commit --author="Zhao Wei Liew <[email protected]>" -F .git/COMMIT_EDITMSG; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment