Re: [PATCH] add Android support

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

 



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.



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]