On Thu, 30 May 2013 14:54:58 -0700 (PDT)
Dallin Lauritzen <dallin.laurit...@gmail.com> wrote:

>>   File "/Library/Python/2.7/site-packages/git/cmd.py", line 377, in
>> execute raise GitCommandError(command, status, stderr_value)
>> GitCommandError: 'git pull' returned exit status -6:
> If anyone else has encountered this error or knows what the -6 means, 
> please help. If it is what I think, I'd appreciate help designing a
> way to slow my script down to avoid this problem.

Well, I don't know how these Python Git bindings work but it sounds
like the exit status is the exit code of a process (`git pull` in this

The exit code of a process is defined to be an integer, and it's
defined that only its least significant 8 bits have any sense [1].
Plus there's a convention (at least on Linux -- I've no time to google
for exact pointers at the moment) that if bit 7 is set in the exit
code, this means the process exited because it was sent an uncaught
signal, and then the rest of the bits define the signal code.

Since bit 7 (MSB) is set, the Python bindings supposedly interpret the
number as negative.  We can subtract this number (-6) form 0 to get the
code of the signal which killed the process.  This will be 6, which, on
Linux (and FreeBSD), means SIGABRT -- the signal which is usually sent
to the process when it calls abort(3).

On a reasonably up-to-date Git tree I see
% git grep -Fw 'abort(' | wc -l

which means there's 18 calls to abort(3) in the Git code.

So my take is that Git encounters certain condition which makes it
"panic" and abort execution.  So I'd try to capture the Git's standard
error stream to see what it printed before aborting.

Note that if you're running an OS other than Linux, the signal numbers
might be different -- check for yourself.

I also wonder what's that `stderr_value` parameter to GitCommandError
is about -- may be it could be somehow inspected to get hold on the
failed command's standard error output?   I'm not Python-literate so
can't tell further.

1. http://pubs.opengroup.org/onlinepubs/009695399/functions/exit.html

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to