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 14, 2015, 21:18 UTC
Message-ID
<20151214211856.GF14788@sigill.intra.peff.net>
In-Reply-To
<1450106584-22313-2-git-send-email-ps@pks.im>
On Mon, Dec 14, 2015 at 04:23:04PM +0100, Patrick Steinhardt wrote:
Show 10 quoted lines
> It is only possible to delete branches on remotes by specifying
> the long '--delete' flag. The `git-branch` command, which can be
> used to delete local branches with the same '--delete' flag, also
> accepts the shorthand '-d'. This may cause confusion for users
> which are frequently using the shorthand form of deleting local
> branches and subsequently try to use the same shorthand for
> `git-push`, which will fail.
> 
> Fix this usability issue by adding the '-d' shorthand to
> `git-push` and document it.

I think we didn't give it "-d" originally, because we usually avoid allocating short-options (which are a limited resource) until an option has proven itself.

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 have been bitten by this myself. I know about "git push origin :ref-to-delete", of course, but my brain would much rather type "-d" (and it's also easier when piping to xargs).

-Peff
Previous: Patrick SteinhardtNext: Junio C Hamano
Message 5 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.