fix behaviors of git-push --porcelain
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest8 patches 3 repliesIn review
- v26 patches 5 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | t5504: modernize test by moving heredocs into test bodiest/ | +16 | 0 replies | |
| 2/8 | t5548: refactor to reuse setup_upstream() functiont/ | +55 | 0 replies | |
| 3/8 | t5548: refactor test cases by resetting upstreamt/ | +67 | 0 replies | |
| 4/8 | t5548: add new porcelain test casest/ | +65 | 0 replies | |
| 5/8 | t5548: add porcelain push test cases for dry-run modet/ | +153 | 1 reply | |
| 6/8 | send-pack: new return code "ERROR_SEND_PACK_BAD_REF_STATUS"send-pack.c send-pack.h transport.c | +12 | 1 reply | |
| 7/8 | t5543: atomic push reports exit code failuret/ | +30 | 0 replies | |
| 8/8 | send-pack: gracefully close the connection for atomic pushsend-pack.c t/ transport.c | +4 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
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