git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/6] Less potent "--force" for "git push"

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 11, 2013, 22:26 UTC
Message-ID
<1373581580-13651-1-git-send-email-gitster@pobox.com>

So here is a reroll to make "--lockref" a weaker form of "--force" that by itself makes "git push" bypass the usual "must fast-forward" check but enforces a different check "the old ref must be at X" instead, taking ideas from J6t. This allows "--force" to be again the big red button to bypass all the safety.

I still am not married to the "lockref" name, and as I said in 3/6, I think "--force-with-lease" might be a better name for it.

The previous round is found at $gmane/229987.

[PATCH v2 1/6] cache.h: move remote/connect API out of it [PATCH v2 2/6] builtin/push.c: use OPT_BOOL, not OPT_BOOLEAN

These are the same from v1
[PATCH v2 3/6] remote.c: add command line option parser for "--lockref"

The earlier one dug the system from both ends and met in the middle, but this UI level change has been moved to the front---the series now digs from the UI surface to the core. The documentation has also been moved to this patch, using the same text as the proposed log message, as Michael Haggerty suggested.

[PATCH v2 4/6] push --lockref: implement logic to populate old_sha1_expect[]
This is unchanged.
[PATCH v2 5/6] push --lockref: tie it all together

This corresponds to old 3/7, but the semantics has been adjusted to allow "--force" override it.

[PATCH v2 6/6] t5533: test "push --lockref"

This has been adjusted to the change in 5/6 (earlier "--force" would not break the "--lockref" safety, but now it does).

Junio C Hamano (6):
  cache.h: move remote/connect API out of it
  builtin/push.c: use OPT_BOOL, not OPT_BOOLEAN
  remote.c: add command line option parser for "--lockref"
  push --lockref: implement logic to populate old_sha1_expect[]
  push --lockref: tie it all together
  t5533: test "push --lockref"
 Documentation/git-push.txt |  68 +++++++++++++---
 builtin/fetch-pack.c       |   2 +
 builtin/push.c             |  18 ++++-
 builtin/receive-pack.c     |   1 +
 builtin/send-pack.c        |  26 +++++++
 cache.h                    |  62 ---------------
 connect.c                  |   1 +
 connect.h                  |  13 ++++
 fetch-pack.c               |   1 +
 fetch-pack.h               |   1 +
 refs.c                     |   8 --
 remote.c                   | 175 +++++++++++++++++++++++++++++++++++++----
 remote.h                   |  83 ++++++++++++++++++++
 send-pack.c                |   2 +
 t/t5533-push-cas.sh        | 189 +++++++++++++++++++++++++++++++++++++++++++++
 transport-helper.c         |   6 ++
 transport.c                |  13 ++++
 transport.h                |   5 ++
 upload-pack.c              |   1 +
 19 files changed, 578 insertions(+), 97 deletions(-)
 create mode 100644 connect.h
 create mode 100755 t/t5533-push-cas.sh
-- 
1.8.3.2-912-g65cf5cf
Next: Junio C Hamano
Message 1 of 7 in “Less potent "--force" for "git push"”
  1. 0/6 Less potent "--force" for "git push"Junio C Hamano, Jul 11, 2013
  2. 1/6 cache.h: move remote/connect API out of itJunio C Hamano, Jul 11, 2013
  3. 2/6 builtin/push.c: use OPT_BOOL, not OPT_BOOLEANJunio C Hamano, Jul 11, 2013
  4. 3/6 remote.c: add command line option parser for "--lockref"Junio C Hamano, Jul 11, 2013
  5. 4/6 push --lockref: implement logic to populate old_sha1_expect[]Junio C Hamano, Jul 11, 2013
  6. 5/6 push --lockref: tie it all togetherJunio C Hamano, Jul 11, 2013
  7. 6/6 t5533: test "push --lockref"Junio C Hamano, Jul 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.