refactor git_getpass into generic prompt function