Re: [PATCH] notes: add `rm` and `delete` commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 10 November 2017 at 12:14 pm +0900, Junio C Hamano wrote:
> Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:
> 
> > or against the change:
> >
> >     - synonym bloat; balloons documentation
> >     - steals command verbs from potential future features
> >     - ...
> 
> I tend to agree with these two (and if I were to replace the "..."
> with something concrete, this change is not desirable because it
> will force us to add all these three when we introduce "remove"
> elsewhere in the system).
> 
> Having said that, this remids me of an age-old topic we discussed in
> a distant past but stalled due to lack of strong drive, which is:
> 
>     Some git subcommands take command verb (e.g. "git notes 'remove'")
>     while others take command mode flags (e.g. "git branch --delete"),
>     and the users need to remember them, which is not ideal.
> 
> I think the consensus back then, if we were to aim for consistency
> by uniformly using only one of the two, is to use the command mode
> flags, simply because existing commands that have the primary mode
> and take an optional command mode flag [*1*] cannot be migrated to
> the command verb UI safely and sanely.
> 
> And then, if we are not careful when we standardize all subcommands
> to take command mode flags, we might end up with a situation where
> some subcommand say "--remove" while other say "--delete", and some
> users will wish to rectify that situation by adding an alias defined
> for these flags---I view this patch as a part of that possible
> future topic ;-).

My motivation was entirely "these were the commands I tried before I
tried `remove` when I wanted to delete a note."  I think both have
precedence in Git with the likes of `git rm` and `git branch --delete`,
although you're entirely correct that I should have at least added that
justification in the commit message.

The matter of which verbs and which flags work where is clearly a much
broader concern.  However at the moment Git uses `rm`, `remove` and
`delete` with no apparent (at least to me) logic about which is used
where, and it seems to me that adding each as synonyms of the other
across the entire suite would improve usability.

In particular, I don't think I buy the argument that it steals verbs: I
can't imagine wanting to use multiple of those verbs in the same context
with different meanings, as that seems liable to cause significant
confusion.

That said, I do get the argument about UI and documentation bloat.  From
my perspective, the cost of that is less than the benefit of having a
more consistent interface, and this is something we can do to have a
more consistent interface *now* without waiting for a larger future
consistency project, but YMMV, and I'm very willing to bow to everyone
else's expertise on this.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux