Skip to content

Finishing touches to "push" advises

Junio C Hamano git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Introduce diff_filespec_is_binary()diff.c diffcore-delta.c diffcore.h+39 -361 reply
1/3ident.c: remove unused variablesident.c+1 -30 replies
1/3t0050: mark non-working test as sucht/t0050-filesystem.sh+6 -20 replies
1/3fetch-pack: factor out hardcoded handshake window sizebuiltin/fetch-pack.c+11 -30 replies
2/3gitweb: rename gitweb_check_feature to gitweb_get_featuregitweb/gitweb.perl+23 -230 replies
2/3ident.c: check explicit identity for name and email separatelybuiltin-commit.c cache.h config.c +1 more+10 -81 reply
2/3tests for "git add ignored-dir/file" without -ft/t2204-add-ignored.sh+79 -00 replies
2/3branch: teach --edit-description optionDocumentation/git-branch.txt builtin/branch.c+71 -22 replies
2/3fixup! t5528-push-default.sh: add helper functionst/t5528-push-default.sh+5 -50 replies
2/3git: protect against unbalanced calls to {save,restore}_env()git.c+7 -01 reply
3/3gitweb: make gitweb_check_feature a boolean wrappergitweb/gitweb.perl+36 -203 replies
3/3ident.c: treat $EMAIL as giving user.email identity explicitlyident.c+3 -20 replies
3/3fetch --all/--multiple: keep all the fetched branch informationbuiltin-fetch.c t/t5521-pull-options.sh+40 -74 replies
3/3builtin-add: fix exclude handlingbuiltin-add.c dir.c dir.h+26 -91 reply
3/3commit: pass author/committer info to hooksbuiltin/commit.c t/t7503-pre-commit-hook.sh+20 -41 reply
3/3push: suggested updates to push configuration documentationDocumentation/config.txt+15 -150 replies
3/3git: simplify environment save/restore logicgit.c+14 -152 replies

Reviews trailers per patch

6 of 17 patches have a Reviewed-by or Acked-by.

PatchSanti Béjar
1/3
1/3
1/3
1/3
2/3A-b
2/3A-b
2/3A-b
2/3A-b
2/3A-b
2/3A-b
3/3
3/3
3/3
3/3
3/3
3/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Finishing touches to "push" advises

This builds on Chris Rorvick's earlier effort to forbid unforced updates to refs/tags/ hierarchy and giving sensible error and advise messages for that case (we are not rejecting such a push due to fast forwardness, and suggesting to fetch and integrate before pushing again does not make sense).

The series applies on top of 256b9d7 (push: fix "refs/tags/ hierarchy cannot be updated without --force", 2013-01-16).

The main change is in the second patch. When we

* do not have the object at the tip of the remote;
* the object at the tip of the remote is not a commit; or
* the object we are pushing is not a commit,

there is no point suggesting to fetch, integrate and push again.

If we do not have the current object at the tip of the remote, we should tell the user to fetch first and evaluate the situation before deciding what to do next.

Otherwise, if the current object is not a commit, or if we are trying to push an object that is not a commit, then the user does not have to fetch first (we already have the object), but it still does not make sense to suggest to integrate and re-push. Just tell them that such a push requires a force in such a case.

Junio C Hamano (3):
push: further clean up fields of "struct ref"
push: introduce REJECT_FETCH_FIRST and REJECT_NEEDS_FORCE
push: further simplify the logic to assign rejection status

 advice.c            |  4 ++++
 advice.h            |  2 ++
 builtin/push.c      | 25 +++++++++++++++++++++++++
 builtin/send-pack.c | 10 ++++++++++
 cache.h             |  6 +++---
 remote.c            | 42 +++++++++++++++++++-----------------------
 send-pack.c         |  2 ++
 transport-helper.c  | 10 ++++++++++
 transport.c         | 14 +++++++++++++-
 transport.h         |  2 ++
 10 files changed, 90 insertions(+), 27 deletions(-)
Signature · 1 line
1.8.1.1.498.gfdee8be