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

Re: git push --confirm ?

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2009, 00:41 UTC
Message-ID
<7vvdjn8ymk.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090912184342.GB20561@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> But what _would_ be useful is doing it atomically. You can certainly do
> all three of those steps from within one "git push" invocation, and I
> think that is enough without any protocol changes. The protocol already
> sends for each ref a line like:
>
>   <old-sha1> <new-sha1> <ref>
>
> and receive-pack will not proceed with the update unless the <old-sha1>
> matches what is about to be changed.

Be careful that using that information and doing things in one session won't give you atomicity in the sense that it may still fail after you said "yes that is what I want to push, really" to the confirmation question.

It does save you an extra connection, compared to separate invocations without and then with --dry-run, so it still is a plus.

I do not think this is an unreasonable option to have. Just please don't justify this change based on atomicity argument, but justify it as a mere convenience feature.

Previous: Daniel BarkalowNext: Jeff King
Message 6 of 10 in “git push --confirm ?”
  1. Owen TaylorSep 12, 2009
  2. Jeff KingSep 12, 2009
  3. Owen TaylorSep 12, 2009
  4. Jeff KingSep 12, 2009
  5. Daniel BarkalowSep 12, 2009
  6. Junio C HamanoSep 13, 2009
  7. Jeff KingSep 13, 2009
  8. Junio C HamanoSep 13, 2009
  9. Jeff KingSep 13, 2009
  10. Uri OkrentSep 13, 2009

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.