[RFC PATCH] config.mak.uname: add HAVE_DEV_TTY to cygwin config section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxxx>
---

Hi,

I found a few minutes to try building with HAVE_DEV_TTY on cygwin tonight
and had a quick test:

  $ printf "%s\n" protocol=https host=example.com path=git | ./git credential fill
  Username for 'https://example.com': user
  Password for 'https://user@xxxxxxxxxxx': 
  protocol=https
  host=example.com
  username=user
  password=pass
  $ 

So, that seems to work. Actually, when I first tried, it didn't work at all,
because I typed 'git credential ...' not './git credential ...'! :)

Also, somewhat surprising, is that job control also works:

  $ printf "%s\n" protocol=https host=example.com path=git | ./git credential fill
  Username for 'https://example.com': 
  [1]+  Stopped                 printf "%s\n" protocol=https host=example.com path=git | ./git credential fill
  $ echo hhh
  hhh
  $ fg
  printf "%s\n" protocol=https host=example.com path=git | ./git credential fill
  user
  Password for 'https://user@xxxxxxxxxxx': 
  protocol=https
  host=example.com
  username=user
  password=pass
  $ 

The only difference between Linux and cygwin seems to be that cygwin does
not echo ^Z when back-grounding.

Still, I need to do a full test suite run, just to check for any regressions.
(Unfortunately, that takes about 6 hours to run, so I can't get to that soon).

Also, I should check other uses of these routines:

  $ git grep -n read_key_without_echo
  add-patch.c:1226:               int res = read_key_without_echo(&s->answer);
  compat/terminal.c:535:int read_key_without_echo(struct strbuf *buf)
  compat/terminal.c:602:int read_key_without_echo(struct strbuf *buf)
  compat/terminal.h:25:int read_key_without_echo(struct strbuf *buf);
  $ 

  $ git grep -n git_terminal_prompt
  compat/terminal.c:428:char *git_terminal_prompt(const char *prompt, int echo)
  compat/terminal.c:597:char *git_terminal_prompt(const char *prompt, int echo UNUSED)
  compat/terminal.h:22:char *git_terminal_prompt(const char *prompt, int echo);
  prompt.c:65:                    r = git_terminal_prompt(prompt, flags & PROMPT_ECHO);
  $ 

  $ git grep -n git_prompt
  builtin/bisect.c:401:           yesno = git_prompt(_("Are you sure [Y/n]? "), PROMPT_ECHO);
  builtin/bisect.c:913:   yesno = git_prompt(_("Do you want me to do it for you "
  credential.c:247:       r = git_prompt(prompt.buf, flags);
  help.c:712:                     answer = git_prompt(msg.buf, PROMPT_ECHO);
  prompt.c:45:char *git_prompt(const char *prompt, int flags)
  prompt.h:7:char *git_prompt(const char *prompt, int flags);
  $ 
  
So, 'add-patch', bisect and help (in addition to git-credential).

[Note: save_term() and restore_term() are not called outside of that TU, so
they could be marked static!]

Anyhow, just a quick heads up.

ATB,
Ramsay Jones


 config.mak.uname | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config.mak.uname b/config.mak.uname
index d0cb2b8244..693dcd4714 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -250,6 +250,7 @@ ifeq ($(uname_O),Cygwin)
         else
 		NO_REGEX = UnfortunatelyYes
         endif
+	HAVE_DEV_TTY = YesPlease
 	HAVE_ALLOCA_H = YesPlease
 	NEEDS_LIBICONV = YesPlease
 	NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
-- 
2.46.0




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux