path: root/prompt.h
AgeCommit message (Collapse)Author
2020-04-10interactive: refactor code asking the user for interactive inputJohannes Schindelin
There are quite a few code locations (e.g. `git clean --interactive`) where Git asks the user for an answer. In preparation for fixing a bug shared by all of them, and also to DRY up the code, let's refactor it. Please note that most of these callers trimmed white-space both at the beginning and at the end of the answer, instead of trimming only the end (as the caller in `add-patch.c` does). Therefore, technically speaking, we change behavior in this patch. At the same time, it can be argued that this is actually a bug fix. Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
2015-01-15prompt.c: remove git_getpass() nobody usesJunio C Hamano
This was whittled down to a compatibility wrapper around the more flexible git_prompt() in 1cb0134f (refactor git_getpass into generic prompt function, 2011-12-10), waiting for the final callers to go away. That happened in 791643a8 (imap-send: use git-credential, 2014-04-28) when imap-send learned to use the credential interface. Reviewed-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2011-12-13prompt: use git_terminal_promptJeff King
Our custom implementation of git_terminal_prompt has many advantages over regular getpass(), as described in the prior commit. This also lets us implement a PROMPT_ECHO flag for callers who want it. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2011-12-13refactor git_getpass into generic prompt functionJeff King
This will allow callers to specify more options (e.g., leaving echo on). The original git_getpass becomes a slim wrapper around the new function. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2011-12-13move git_getpass to its own source fileJeff King
This is currently in connect.c, but really has nothing to do with the git protocol itself. Let's make a new source file all about prompting the user, which will make it cleaner to refactor. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>