From: Sitaram Chamarty Date: Thu, 31 May 2012 03:14:25 GMT Subject: Re: How to handle terminal detection in a daemon calling git? Message-ID: In-Reply-To: <1338412607.9452.140661082904349.02F677C3@webmail.messagingengine.com> On Thu, May 31, 2012 at 2:46 AM, Travis P wrote: > > I've got a script that runs in the background without a terminal. > It actually does have STDOUT and STDERR set to a rotating log file. > > When it runs: >  /bin/sh -c 'cd /to/my/wc; git pull --ff-only' > the git command fails (rc 32768). > > When it runs >  /bin/sh -c 'cd /to/my/wc; git pull --ff-only > /to/a/file 2>&1' > > or even >  /bin/sh -c 'cd /to/my/wc; git pull --ff-only | cat' > > then all is well.  The command succeeds (rc 0, and I see the expected > results). > > Piping through 'cat' is okay, but I'd rather avoid the 'trick'.  Is > there > some way to communicate to git that it should operate just as if output > were redirected? would "git --no-pager" help? Honestly I don't know why your first error occurred at all -- they should all have worked, IMO.