/gist:16f801654dcd474ceb6b Secret
Created
January 15, 2013 17:52
Star
You must be signed in to star a gist
prepare-commit-msg
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
| #!/usr/bin/env python | |
| import sys, os | |
| sys.stdin = open('/dev/tty') | |
| print "Enter 'foo' for Foo or 'bar' for bar's information." | |
| name = raw_input("Please enter your full name: ") | |
| email = str() | |
| if name.strip() == "foo": | |
| name = "foo fooster" | |
| email = "foo@foo.foo" | |
| elif name.strip() == "bark": | |
| name = "bar barington" | |
| email = "bar@bar.none" | |
| else: | |
| email = raw_input("Please enter your e-mail address: ") | |
| ## unset current name / e-mail address | |
| os.system("git config --global --remove-section user") | |
| set_name = 'git config --global user.name "%s"' % (name) | |
| set_email = 'git config --global user.email "%s"' % (email) | |
| ## set the name / e-mail address | |
| os.system(set_name) | |
| os.system(set_email) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment