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

2 messages from 2024-08-31 to 2024-09-05. Participants: Ramsay Jones, Jeff King.
Thread: https://gitlist.dev/t/62030

## Ramsay Jones, 2024-08-31 14:58

Subject: [PATCH v2] compat/terminal: mark parameter of git_terminal_prompt() UNUSED
Message-ID: <ce1c1d66-e0eb-4143-b334-1a83c0492415@ramsayjones.plus.com>
URL: https://gitlist.dev/e/ce1c1d66-e0eb-4143-b334-1a83c0492415%40ramsayjones.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

```

## Jeff King, 2024-09-05 10:48

Subject: Re: [PATCH v2] compat/terminal: mark parameter of git_terminal_prompt() UNUSED
Message-ID: <20240905104812.GA2598693@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20240905104812.GA2598693%40coredump.intra.peff.net
In-Reply-To: <ce1c1d66-e0eb-4143-b334-1a83c0492415@ramsayjones.plus.com>

```
On Sat, Aug 31, 2024 at 03:58:56PM +0100, Ramsay Jones wrote:

> Sorry for being a bit tardy with this, but I'm up-to-my-ears! :)

Well, then I don't feel so bad about being late to respond. :)

> 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 ...).

This looks great to me, and I think the authorship is fine as it is. The
hard part IMHO was finding the problem in the first place!

-Peff

```
