From: Rafael Gieschke <rafael@gieschke.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] add Android support
Date: Tue, 17 May 2011 01:23:22 +0200 [thread overview]
Message-ID: <D01E807D-C82C-4A8F-9678-9CEA92C413DA@gieschke.de> (raw)
In-Reply-To: <7vzkmmjqpx.fsf@alter.siamese.dyndns.org>
Am 16.05.2011 um 23:11 schrieb Junio C Hamano:
> Please do not throw in conditional compilation in a codepath that is
> otherwise generic.
>
> Do something like this near the beginning of the file (or if they are
> common, in an appropriate header):
>
> #ifdef NO_GETPASS
> #define getpass(ignored) NULL
> #endif
>
> #ifdef NO_PW_GECOS
> #define get_gecos(ignored) "&"
> #else
> #define get_gecos(struct_passwd) (struct_passwd->pw_gecos)
> #endif
>
> That way, you do not have to change connect.c at all, and the code that
> accesses gecos field would get a slight abstraction, i.e.
>
> for (len = 0, dst = name, src = get_gecos(w); len < sz; src++) {
> ...
>
Thanks. Great idea, didn't think about that. See new patch.
> I however suspect that NO_GETPASS would be a useless thing in the longer
> term. Wouldn't you rather wish to have a native Android UI that asks a
> password and plug that implementation as a replacement for git_getpass()?
>
> It might be worthwhile to study how mingw folks do this part before you
> dive in and butcher this codepath in a way you may regret later.
>
I don't think that it is a lot of fun to call Android UI code from C as it is normally only done from Java.
The same problem occurs in dropbear on Android. There, it is solved by including a NetBSD version of getpass.c: https://github.com/CyanogenMod/android_external_dropbear/blob/master/netbsd_getpass.c .
If including NetBSD code is okay, the new patch will work. There currently is very limited use for this on Android, however, as there is no libcurl by default on Android. So, the only usage is git-imap-send, which works fine with this patch.
Compiling libcurl for Android should be possible with some work, though. So compat/getpass.c would be used for libcurl/HTTP access, too.
next prev parent reply other threads:[~2011-05-16 23:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-16 20:08 [PATCH] add Android support Rafael Gieschke
2011-05-16 21:11 ` Junio C Hamano
2011-05-16 23:23 ` Rafael Gieschke [this message]
2011-05-17 6:44 ` Daniel Stenberg
2011-05-19 17:30 ` Rafael Gieschke
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=D01E807D-C82C-4A8F-9678-9CEA92C413DA@gieschke.de \
--to=rafael@gieschke.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).