From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [RFC PATCH] gc --auto: don't lie about running in background on Windows
Date: Sat, 07 May 2016 16:44:51 +0200 [thread overview]
Message-ID: <20160507164451.Horde.S4kJBIYRkpnmQt7tw82MHDH@webmail.informatik.kit.edu> (raw)
In-Reply-To: <xmqqbn4kcvuc.fsf@gitster.mtv.corp.google.com>
Quoting Junio C Hamano <gitster@pobox.com>:
> SZEDER Gábor <szeder@ira.uka.de> writes:
>
>> Arguably this helper function could be just a simple variable. I
>> opted for a function because:
>>
>> - I preferred a single '#ifdef NO_POSIX_GOODIES', and putting a
>> static variable so near to EOF felt just wrong. (And this is why
>> it's not an inline-able function defined in a header file.)
>>
>> - currently we know already at compile time that Windows can't
>> daemonize, but in the future we might want to extend this helper
>> function to perform some runtime checks, too. But this is perhaps
>> like preparing for crossing a bridge where we'll never get to.
>
> Alternatively, the implementation of daemonize() and can_daemonize()
> can live in compat/ and have the #ifdef switch in git-compat-util.h,
> e.g. something along the lines of these:
>
> << git-compat-util.h >>
> ... after conditional inclusion of compat/mingw.h ...
> #ifndef can_daemonize
> #define can_daemonize() 1
> #endif
>
> << compat/mingw.h >>
> #define can_daemonize() 0
> #define daemonize() mingw_daemonize()
>
> << setup.c >>
> ...
> #ifndef NO_POSIX_GOODIES
> int daemonize(void)
> {
> ... no ifdef around here ...
> }
> #endif
config.mak.uname sets NO_POSIX_GOODIES only for Windows builds, but
NO_POSIX_GOODIES doesn't sound Windows-specific at all. Currently if
somebody were to decide to build with NO_POSIX_GOODIES=UnfortunatelyYes,
then he would get a working git in the end, even on non-Windows
platforms. With the proposed alternative above we would only provide an
alternative daemonize() implementation for MINGW, breaking the build of
those setting NO_POSIX_GOODIES by themselves.
I don't know whether there are platforms out there besides Windows that
need the NO_POSIX_GOODIES treatment, but we don't explicitly support
them in config.mak.uname, or people who for whatever reason build with
this knob turned on.
prev parent reply other threads:[~2016-05-07 14:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-01 15:37 [PATCH] t5510: run auto-gc in the foreground SZEDER Gábor
2016-05-02 7:01 ` Johannes Schindelin
2016-05-02 23:55 ` SZEDER Gábor
2016-05-03 11:50 ` SZEDER Gábor
2016-05-04 5:48 ` Johannes Schindelin
2016-05-05 15:14 ` SZEDER Gábor
2016-05-05 15:16 ` [RFC PATCH] gc --auto: don't lie about running in background on Windows SZEDER Gábor
2016-05-05 16:28 ` Junio C Hamano
2016-05-07 14:44 ` SZEDER Gábor [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160507164451.Horde.S4kJBIYRkpnmQt7tw82MHDH@webmail.informatik.kit.edu \
--to=szeder@ira.uka.de \
--cc=Johannes.Schindelin@gmx.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).