Skip to content

push: add "--[no-]force-if-includes"

Srinidhi Kaushik git 10 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest3 patches 0 repliesNew
  2. v93 patches 16 repliesSuperseded
  3. v83 patches 7 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v73 patches2 repliesSuperseded
v63 patches1 replySuperseded
v53 patches5 repliesSuperseded
v43 patches11 repliesSuperseded
v37 patches10 repliesSuperseded
v22 patches5 repliesSuperseded
v11 patch23 repliesSuperseded

Changes in v10 from the cover letter

- Remove "toggle_commit_graph()" because "in_merge_bases_many()" has been fixed [1].

- Rename "reflog_commit_list" to "reflog_commit_array", and related comments.

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3push: add reflog check for "--force-if-includes"builtin/send-pack.c remote.c remote.h +3 more+205 -80 replies
2/3push: parse and set flag for "--force-if-includes"advice.c advice.h builtin/push.c +5 more+68 -60 replies
3/3t, doc: update tests, reference for "--force-if-includes"Documentation/config/advice.txt Documentation/config/push.txt Documentation/git-push.txt +1 more+174 -40 replies

Reviews trailers per patch

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

Read the v10 thread

Cover letter [PATCH v10 0/3] push: add "--[no-]force-if-includes"

Add a new option: "--force-if-includes" to "git-push" where forced updates are allowed only if the tip of the remote-tracking ref has been integrated locally, by verifying if the tip of the remote-tracking ref -- on which a local branch has based on -- is reachable from at least one of the "reflog" entries of the branch about to be updated by force on the remote.

This option can be used with "--force-with-lease" with setups where the remote-tracking refs of the repository are implicitly updated in the background to help prevent unintended remote overwrites.

If a local branch is based on a remote ref for a rewrite, and if that remote-tracking ref is updated by a push from another repository after it has been checked out locally, force updating that branch to remote with "--force-with-lease[=<refname>[:<expect>]]" without specifying the "<expect>" value, can cause the update that happened in-between the checkout and forced push to be lost.

Changes since v9:
- Remove "toggle_commit_graph()" because "in_merge_bases_many()" has been fixed [1].

- Rename "reflog_commit_list" to "reflog_commit_array", and related comments.

Srinidhi Kaushik (3):
push: add reflog check for "--force-if-includes"
push: parse and set flag for "--force-if-includes" t, doc: update tests, reference for "--force-if-includes"

 Documentation/config/advice.txt |   9 +-
 Documentation/config/push.txt   |   6 ++
 Documentation/git-push.txt      |  26 ++++-
 advice.c                        |   3 +
 advice.h                        |   2 +
 builtin/push.c                  |  27 +++++
 builtin/send-pack.c             |  11 ++
 remote-curl.c                   |  14 ++-
 remote.c                        | 184 ++++++++++++++++++++++++++++++--
 remote.h                        |  12 ++-
 send-pack.c                     |   1 +
 t/t5533-push-cas.sh             | 137 ++++++++++++++++++++++++
 transport-helper.c              |  10 ++
 transport.c                     |   8 ++
 transport.h                     |  15 ++-
 15 files changed, 447 insertions(+), 18 deletions(-)

base-commit: aed0800ca6 (Merge branch 'ds/in-merge-bases-many-optim-bug'

			 into sk/force-if-includes, 2020-10-02)

[1] https://public-inbox.org/git/[email protected]
--
2.28.0