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

Re: [PATCH 2/2] push: add '-d' as shorthand for '--delete'

From
Jeff King <peff@peff.net>
Date
Dec 16, 2015, 21:52 UTC
Message-ID
<20151216215252.GA11615@sigill.intra.peff.net>
In-Reply-To
<xmqqr3imcf2l.fsf@gitster.mtv.corp.google.com>
On Wed, Dec 16, 2015 at 12:29:38PM -0800, Junio C Hamano wrote:
Show 19 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > At this point, it seems that "--delete" is useful, and nothing else has
> > been proposed for "-d" in the intervening years. It seems like a
> > reasonable use of the flag to me.
> 
> I think there were two (and a half) reasons why we didn't let
> "--delete" use a short-and-sweet "-d", and I agree that "something
> else that is more useful did not come" removes one of them.
> 
> The other reason was to avoid the chance of fat-fingering, because
> deleting is destructive, and it is even harder to recover from if
> the damage is done remotely (and the remaining one-half is that
> deleting is a rare event).
> 
> Even though I do not think the need for the "safety" has been
> reduced over time to warrant this change, a similarity with "branch"
> that has "-d/--delete" would be a good enough argument to support
> this change.

Thanks for the input, I hadn't considered "safety" at all. We do have safety measures on "git branch -d" that we don't have here. I guess we could implement something similar (e.g., see if the to-be-deleted branch is merged elsewhere; of course we might not have the objects locally at all). On the other hand, you can already screw yourself pretty badly with "push -f".

So I think it's probably OK to add "-d".
-Peff
Previous: Junio C Hamano
Message 7 of 7 in “push: add '--delete' flag to synopsis”
  1. 1/2 push: add '--delete' flag to synopsisPatrick Steinhardt, Dec 14, 2015
  2. 2/2 push: add '-d' as shorthand for '--delete'Patrick Steinhardt, Dec 14, 2015
  3. Junio C HamanoDec 14, 2015
  4. Patrick SteinhardtDec 15, 2015
  5. Jeff KingDec 14, 2015
  6. Junio C HamanoDec 16, 2015
  7. Jeff KingDec 16, 2015

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.