Subject: Re: [PATCH v2 2/2] gc: config option for running --auto in background

From: Junio C Hamano <[email-masked]>
Date: Mon, 10 Feb 2014 10:43:43 -0800

Duy Nguyen <[email-masked]> writes:

> On Mon, Feb 10, 2014 at 6:03 PM, Erik Faye-Lund <[email-masked]> wrote:
>>> `gc --auto` takes time and can block the user temporarily (but not any
>>> -               if (!quiet)
>>> -                       fprintf(stderr,
>>> -                                       _("Auto packing the repository for optimum performance. You may also\n"
>>> -                                       "run \"git gc\" manually. See "
>>> -                                       "\"git help gc\" for more information.\n"));
>>> +               if (!quiet) {
>>> +                       if (detach_auto)
>>> +                               fprintf(stderr, _("Auto packing the repository in background for optimum performance.\n"));
>>> +                       else
>>> +                               fprintf(stderr, _("Auto packing the repository for optimum performance.\n"));
>>> +                       fprintf(stderr, _("See \"git help gc\" for manual housekeeping.\n"));
>>> +               }
>>> +               if (detach_auto)
>>> +                       /*
>>> +                        * failure to daemonize is ok, we'll continue
>>> +                        * in foreground
>>> +                        */
>>> +                       daemonize();
>>
>> While I agree that it should be OK, shouldn't we warn the user?
>
> If --quiet is set, we should not be printing anyway. If not, I thinkg
> we could only print "auto packing in background.." when we actually
> can do that, else just print the old message. It means an #ifdef
> NO_POSIX_GOODIES here again though..

Didn't you change it not to die but return nosys or something?