git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] compat/terminal: mark parameter of git_terminal_prompt() UNUSED

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Aug 31, 2024, 14:58 UTC
Message-ID
<ce1c1d66-e0eb-4143-b334-1a83c0492415@ramsayjones.plus.com>

If neither HAVE_DEV_TTY nor GIT_WINDOWS_NATIVE is set, the fallback code calls the system getpass(). This unfortunately ignores the "echo" boolean parameter, as we have no way to implement that functionality. But we still have to keep the unused parameter, since our interface has to match the other implementations.

Co-authored-by: Jeff King <peff@peff.net>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi,
Sorry for being a bit tardy with this, but I'm up-to-my-ears! :)

I feel a bit sheepish about taking authorship of this patch, since Jeff contributed way more than I did to the text! (I was going to count the words to get a better metric, but I have to go out now; if I don't send this now it will be tomorrow ...).

ATB, Ramsay Jones

 compat/terminal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/terminal.c b/compat/terminal.c
index 0afda730f2..d54efa1c5d 100644
--- a/compat/terminal.c
+++ b/compat/terminal.c
@@ -594,7 +594,7 @@ void restore_term(void)
 {
 }
 
-char *git_terminal_prompt(const char *prompt, int echo)
+char *git_terminal_prompt(const char *prompt, int echo UNUSED)
 {
 	return getpass(prompt);
 }
-- 
2.46.0
Next: Jeff King
Message 1 of 2 in “compat/terminal: mark parameter of git_terminal_prompt() UNUSED”
  1. compat/terminal: mark parameter of git_terminal_prompt() UNUSEDRamsay Jones, Aug 31, 2024
  2. Jeff KingSep 5, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.