Skip to content

rework run_command error reporting

Johannes Sixt git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7MinGW: truncate exit()'s argument to lowest 8 bitscompat/mingw.h git.c+3 -10 replies
1/7Truncate result of run_command that is used in exit() to lowest 8 bitsbisect.c builtin-add.c+3 -30 replies
2/7MinGW: simplify waitpid() emulation macroscompat/mingw.h+3 -20 replies
3/7run_command: return exit code as positive valuebuiltin-merge.c builtin-receive-pack.c convert.c +4 more+7 -190 replies
4/7run_command: report system call errors instead of returning error codesbuiltin-receive-pack.c git.c run-command.c +3 more+59 -873 replies
5/7run_command: encode deadly signal number in the return valuerun-command.c+8 -10 replies
6/7run_command: report failure to execute the program, but optionally don'tbuiltin-receive-pack.c git.c run-command.c +2 more+13 -130 replies
7/7receive-pack: remove unnecessary run_status reportbuiltin-receive-pack.c+4 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] rework run_command error reporting

I got tired of thinking about which return values of run_command functions are exit codes and which are error codes of system call failures.

Furthermore, it is a pitty that almost no run_command callers correctly report system call failures.

But on top of all I find it unacceptable that recent git-daemon logs "unable to run 'git-pack-objects'" if a client terminates the connection early.

This series addresses these issues, and also fixes an error in git-bisect on Windows.

1/7 Truncate result of run_command that is used in exit() to lowest 8 bits

This one fixes a breakage of git-bisect on Windows and should be applied at any rate.

2/7 MinGW: simplify waitpid() emulation macros
3/7 run_command: return exit code as positive value
4/7 run_command: report system call errors instead of returning error codes

These address the mentioned issues; 4/7 is the important change.

5/7 run_command: encode deadly signal number in the return value 6/7 run_command: report failure to execute the program, but optionally don't

These two are nice to have.

7/7 receive-pack: remove unnecessary run_status report

This one is actually RFC because it removes a status report that users might be used to see, or even depend on.

 bisect.c                     |    4 +-
 builtin-add.c                |    2 +-
 builtin-merge.c              |    2 +-
 builtin-receive-pack.c       |   38 ++--------------
 compat/mingw.h               |    5 +-
 convert.c                    |    2 +-
 git.c                        |   10 +---
 ll-merge.c                   |    4 --
 run-command.c                |  105 +++++++++++++++++++++++------------------
 run-command.h                |   13 +----
 t/t5530-upload-pack-error.sh |    5 ++-
 transport.c                  |   16 +------
 12 files changed, 81 insertions(+), 125 deletions(-)