Skip to content

fix behaviors of git-push --porcelain

Jiang Xin git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 3 repliesIn review
  2. v26 patches 5 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8t5504: modernize test by moving heredocs into test bodiest/t5504-fetch-receive-strict.sh+16 -190 replies
2/8t5548: refactor to reuse setup_upstream() functiont/t5548-push-porcelain.sh+55 -300 replies
3/8t5548: refactor test cases by resetting upstreamt/t5548-push-porcelain.sh+67 -820 replies
4/8t5548: add new porcelain test casest/t5548-push-porcelain.sh+65 -250 replies
5/8t5548: add porcelain push test cases for dry-run modet/t5548-push-porcelain.sh+153 -01 reply
6/8send-pack: new return code "ERROR_SEND_PACK_BAD_REF_STATUS"send-pack.c send-pack.h transport.c+12 -71 reply
7/8t5543: atomic push reports exit code failuret/t5543-atomic-push.sh+30 -00 replies
8/8send-pack: gracefully close the connection for atomic pushsend-pack.c t/t5543-atomic-push.sh transport.c+4 -111 reply

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/8] fix behaviors of git-push --porcelain

From: Jiang Xin <[email protected]>

Patrick reported an issue that the exit code of git-receive-pack(1) is ignored during atomic push with "--porcelain" flag, and added new test cases in t5543.

This issue originated from commit 7dcbeaa0df (send-pack: fix inconsistent porcelain output, 2020-04-17). At that time, I chose to ignore the exit code of "finish_connect()" without investigating the root cause of the abnormal termination of git-receive-pack. That was an incorrect solution.

The root cause is that an atomic push operation terminates early without sending a flush packet to git-receive-pack. As a result, git-receive-pack continues waiting for commands without exiting. By sending a flush packet at the appropriate location in "send_pack()", we ensure that the git-receive-pack process closes properly, avoiding an erroneous exit code for git-push.

# Changes since v2

* Split the changes made to t5548 into several commits for clarity.

* Correct the inconsistent return code of "push_refs()" across different transports to ensure that git push --porcelain behaves consistently.

* Gracefully close the connection for early exist of atomic push to resolve to root cause of wrong exit code of atomic git-push.

--

Jiang Xin (6):
t5548: refactor to reuse setup_upstream() function
t5548: refactor test cases by resetting upstream
t5548: add new porcelain test cases
t5548: add porcelain push test cases for dry-run mode
send-pack: new return code "ERROR_SEND_PACK_BAD_REF_STATUS"
send-pack: gracefully close the connection for atomic push

Patrick Steinhardt (2):
t5504: modernize test by moving heredocs into test bodies
t5543: atomic push reports exit code failure

 send-pack.c                     |  10 +-
 send-pack.h                     |   3 +
 t/t5504-fetch-receive-strict.sh |  35 ++-
 t/t5543-atomic-push.sh          |  30 +++
 t/t5548-push-porcelain.sh       | 425 +++++++++++++++++++++++---------
 transport.c                     |  17 +-
 6 files changed, 374 insertions(+), 146 deletions(-)
Signature · 1 line
2.47.0.rc1.21.g81e7bd6151