git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Frank Li <lznuaa@gmail.com>, git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH v2 2/3] git-core: Support retrieving passwords with GIT_ASKPASS
Date: Thu, 25 Feb 2010 23:50:12 -0800	[thread overview]
Message-ID: <7vr5o84erv.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4B87797D.7030905@viscovery.net> (Johannes Sixt's message of "Fri\, 26 Feb 2010 08\:34\:21 +0100")

Johannes Sixt <j.sixt@viscovery.net> writes:

> BTW, to save a level of indentation, you could handle the "trivial" case
> early like this:
>
> 	if (!askpass || !*askpass)
> 		return get_pass(prompt);
>
> and continue without an 'else' branch.

That is a good advice in general.

Also, when you have a way unbalanced if ... else ... where else clause is
very small, it usually is much easier to read if you invert the logic to
make if part smaller.

> OTOH, it may be worthwhile to set
>
> 		pass.use_shell = 1;
>
> to allow commands that are not just a single plain word. But perhaps this
> has security implications - I don't know.

How does SSH_ASKPASS gets interpreted by other programs?  I think we
should follow that example.

Other than that, I agree with everything you said in your review.  Thanks.

  reply	other threads:[~2010-02-26  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26  0:12 [PATCH v2 2/3] git-core: Support retrieving passwords with GIT_ASKPASS Frank Li
2010-02-26  0:50 ` Miklos Vajna
2010-02-26  2:17   ` Frank Li
2010-02-26  7:34 ` Johannes Sixt
2010-02-26  7:50   ` Junio C Hamano [this message]
2010-02-26  9:32     ` Johannes Sixt
2010-02-26 17:50       ` Junio C Hamano
2010-02-26 10:01   ` Frank Li

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=7vr5o84erv.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=lznuaa@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).