All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: kusmabite@gmail.com
Cc: Rafael Gieschke <rafael@gieschke.de>, git@vger.kernel.org
Subject: Re: [PATCH] compat: add a getpass() compatibility function
Date: Thu, 19 May 2011 09:30:08 -0700	[thread overview]
Message-ID: <7vmxii8xgv.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <BANLkTinPHeSfZXRb7pqt7-XWkR5fH=wAjg@mail.gmail.com> (Erik Faye-Lund's message of "Thu, 19 May 2011 14:17:33 +0200")

Erik Faye-Lund <kusmabite@gmail.com> writes:

> Do we really need two implementations? Wouldn't it be better to factor
> out the mingw-version to a separate source file, and then improve it?

Thanks for reminding.

> Windows doesn't have /dev/tty, but the logic in this version handles
> that by using stdin/stderr instead. The signal-stuff has a comment
> that indicates it might not even be correct. tcgetattr/tcsetattr isn't
> supported on Windows, but it's not needed if we use getch (as the
> version in compat/mingw.c does). POSIX/curses getch respects the
> echo-setting, while Windows getch never echo.

I forgot to check how generic/reusable mingw version would look. As you
said, it does feel a lot more attractive approach if it is trivial to add
the "noecho" bit to it, tweak the tty-ness and deal with signals.

I however suspect the result would end up on the borderline to be called
"trivial", rough guestimate being 3-4 times as large as the 14-line mingw
version. But it certainly feels that it is worth a try.

  reply	other threads:[~2011-05-19 16:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 11:37 [PATCH] compat: add a getpass() compatibility function Rafael Gieschke
2011-05-19 12:17 ` Erik Faye-Lund
2011-05-19 16:30   ` Junio C Hamano [this message]
2011-05-19 17:01   ` Rafael Gieschke
2011-05-19 17:27     ` Junio C Hamano
2011-05-19 18:07       ` Erik Faye-Lund
2011-05-19 19:16         ` Rafael Gieschke
2011-05-19 19:19           ` Erik Faye-Lund
2011-05-19 19:42             ` Rafael Gieschke
2011-05-19 20:12               ` Erik Faye-Lund
2011-05-19 21:16                 ` Erik Faye-Lund
2011-05-20 10:06                   ` Rafael Gieschke
2011-05-20 10:48                     ` Erik Faye-Lund
2011-05-20 17:18                       ` Junio C Hamano
2011-05-20 17:26                         ` Erik Faye-Lund
2011-05-19 12:21 ` Erik Faye-Lund
2011-05-19 15:14   ` Jonathan Nieder
2011-05-19 15:29     ` Erik Faye-Lund
2011-05-19 17:17     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vmxii8xgv.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@gmail.com \
    --cc=rafael@gieschke.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.