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