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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 10, 2017, 03:14 UTC
Message-ID
<xmqq1sl6j04b.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAPig+cRq7thrPtzS0V6o-wMhHyYWKeWg-xOQhnWCO5sLE=kDcw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 5 quoted lines
> 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 ;-).

[Footnote]
*1* For example, "git branch" by default is in the branch creation
    mode, but it can be told to work in its branch deletion mode
    with "--delete".
    If we were to standardize on command verbs, is "git branch
    delete" a deprecated relic from the old world that wants to
    create a branch whose name is 'delete', or is it done by a
    script in the new world that collected names of branches to
    delete and asked "git branch delete $to_delete" to delete all of
    them, where the $to_delete variable happened to end up empty?
    With command mode flags, we do not have to worry about such an
    ambiguity during and after transition.
Previous: Eric SunshineNext: Adam Dinwoodie
Message 3 of 4 in “notes: add `rm` and `delete` commands”
  1. notes: add `rm` and `delete` commandsAdam Dinwoodie, Nov 9, 2017
  2. Eric SunshineNov 9, 2017
  3. Junio C HamanoNov 10, 2017
  4. Adam DinwoodieNov 10, 2017

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.