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

Re: [PATCH v3 0/6]

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2013, 18:26 UTC
Message-ID
<7v8v0x874x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<loom.20130723T113216-324@post.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
Show 11 quoted lines
> Junio C Hamano <gitster <at> pobox.com> writes:
>
>> 
>> This is mostly unchanged since the previous round, except that
>> 
>>  * The option is spelled "--force-with-lease=<ref>:<expect>".
>>    Nobody liked "cas" as it was too technical, many disliked
>>    "lockref" because "lock" sounded as if push by others were
>>    excluded by it while in fact this is to fail us.
>
> Perhaps "--force-gently" ? :-)

Hmph. But we usually use "gently" to mean "do not give the end user an error message--the caller handles the error itself".

While the option lets you break the usual "must fast-forward" rule, it is more precise in that the remote ref must be pointing at not just any ancestor of what you are pushing, but has to be at the exact commit you specify.

E.g. if you have built one commit on top of the shared branch, and try to push it with "push --cas=pu:HEAD^ HEAD:pu" (because you know one commit before the tip is where you started from), your push will be rejected if somebody else did an equivalent of "reset HEAD~3" on the receiving end (perhaps because the top commits recorded some material inappropriate for the project). Your new commit is still a decendant of that rewound tip, and usual "must fast-forward" rule would accept the push, but with "push --cas=pu:HEAD^ HEAD:pu", you will notice that somebody wanted to rewind the tip and pushing your work that contains these dropped commit contradicts with that wish.

So I dunno.
Previous: Jakub NarebskiNext: Philip Oakley
Message 9 of 14 in “"git push --cas/--lockref" renamed to "--force-with-lease"”
  1. 0/6 "git push --cas/--lockref" renamed to "--force-with-lease"Junio C Hamano, Jul 23, 2013
  2. 1/6 cache.h: move remote/connect API out of itJunio C Hamano, Jul 23, 2013
  3. 2/6 builtin/push.c: use OPT_BOOL, not OPT_BOOLEANJunio C Hamano, Jul 23, 2013
  4. 3/6 remote.c: add command line option parser for "--force-with-lease"Junio C Hamano, Jul 23, 2013
  5. 4/6 push --force-with-lease: implement logic to populate old_sha1_expect[]Junio C Hamano, Jul 23, 2013
  6. 5/6 push --force-with-lease: tie it all togetherJunio C Hamano, Jul 23, 2013
  7. 6/6 t5533: test "push --force-with-lease"Junio C Hamano, Jul 23, 2013
  8. Jakub NarebskiJul 23, 2013
  9. Junio C HamanoJul 23, 2013
  10. Philip OakleyJul 23, 2013
  11. Eric SunshineJul 23, 2013
  12. 7/6 t5540/5541: smart-http does not support "--force-with-lease"Junio C Hamano, Aug 1, 2013
  13. 8/6 send-pack: fix parsing of --force-with-lease optionJunio C Hamano, Aug 2, 2013
  14. 9/6 push: teach --force-with-lease to smart-http transportJunio C Hamano, Aug 2, 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.