All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glen Choo <chooglen@google.com>
To: Sergey Organov <sorganov@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: so/diff-merges-more (was Re: What's cooking in git.git (Feb 2023, #01; Thu, 2))
Date: Wed, 01 Mar 2023 16:37:51 -0800	[thread overview]
Message-ID: <kl6lh6v43s4g.fsf@chooglen-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <87wn4tej2f.fsf@osv.gnss.ru>

Sergey Organov <sorganov@gmail.com> writes:

>>   If the goal is to reduce typing, then we could add a different CLI
>>   flag that would behave like "-m -p", or we could teach "git diff" to
>>   accept proper single-character flags. Either of these options would be
>>   more discoverable and cleaner.
>
> The only drawback of this is that this leaves "-m" inconsistent with no
> apparent reason.
> [...]
> Then, out of curiosity, what do you think was the reason to change
> "--cc" behavior to match that of "-c"? To save typing? To me, changing
> "-m" accordingly is an improvement to the overall feel of git interface,
> the same way as changing "--cc" was.

FWIW, I agree that having an inconsistent "-m" is quite an eyesore, and
there isn't a particularly good reason for it.

The unfortunate reality of Hyrum's law is that some 'mistakes' or CLI
cleanups are difficult or even downright impossible to fix. I'd consider
"-m on its own does nothing" one of those.

> All you say is understood and are valid arguments, but then we will
> continue to face pretty valid confusion of why "-m" behaves differently
> from "-c/--cc/--remerge". I personally don't care, provided I get a way
> to make it behave sanely, and that's what "log.diffMerges-m-imply-p"
> patch does.

We could say, e.g.:

  "-m" is inconsistent, but we can't change it for backwards
  compatibility reasons. Please do not use it, use "-d" instead, because
  that is more sensible.

> As a kind of complaint, it was simple 1 patch from Junio once upon a
> time to change "--cc" to a sane behavior of implying -p, and now it
> takes rounds and rounds to do the same for -m. This is rather sad.

It is not because Junio has special privileges or anything of the sort,
though. My understanding is that it was just an accident that "-m"
_happened_ to be misused by enough people that we deemed that breakage
unacceptable, whereas "--cc" just _happened_ to be fixable.

FWIW, I might have also been on your side when we rolled back the first
"-m" implies "-p" change, but the consensus since then is that breaking
backwards compatibility just isn't worth it in this case, and it would
take a herculean effort to change that consensus. It might not be
completely impossible though, more on that later...

> Finally, event without "log.diffMerges-m-imply-p", the rest of the
> series still makes sense, so if the conclusion is to remove it, let's
> still merge the rest, please! Let me know, and I'll then remove the
> patch and will change documentation accordingly.

Oops. Sorry, I missed this the first time I read this message. This
alone should have warranted a response.

I'm not convinced that the series makes sense without
"log.diffMerges-m-imply-p":

* The main patch is

    diff-merges: implement [no-]hide option and log.diffMergesHide config

  which gives us a way to redefine "-m" as "--diff-merges=hide
  --diff-merges=on". However, we haven't seen any compelling reasons to
  use --diff-merges=hide [1]. I'm also fairly convinced that if we go
  back in time, "-m" wouldn't have the semantics of 'do nothing unless
  -p is also given', and I don't think we should immortalize a mistake
  by giving it an explicit option.

  All the other patches in their current form are dependent on this
  patch going in.

* diff-merges: support list of values for --diff-merges

  This only makes sense if we want to accept multiple values, which we
  don't without the main patch.

* diff-merges: issue warning on lone '-m' option
  diff-merges: improve --diff-merges documentation

  These are docs and UX cleanups as a result of the main patch.

_Maybe_ the number of lone "-m" users will shrink over time to the point
where we could make the switch? We could prepare for that by warning
that lone "-m" is a no-op now, but might imply "-p" at some point in the
future, and then after X amount of time, we might say that users have
had enough warning and actually change the default. I find this
unlikely, but not impossible. However, the patches don't prepare us for
this path, and that would deserve new patches and a different discussion
from what we've been having.

1. https://lore.kernel.org/git/kl6lilimepli.fsf@chooglen-macbookpro.roam.corp.google.com/

  reply	other threads:[~2023-03-02  0:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03  4:02 What's cooking in git.git (Feb 2023, #01; Thu, 2) Junio C Hamano
2023-02-04  9:33 ` Sergey Organov
2023-02-06 18:35   ` Junio C Hamano
2023-02-06 21:35     ` Sergey Organov
2023-03-01 18:40       ` Sergey Organov
2023-03-01 22:15         ` Junio C Hamano
2023-03-01 22:26           ` Sergey Organov
2023-03-01 23:54             ` Glen Choo
2023-03-02 14:38               ` Sergey Organov
2023-02-07  4:06   ` so/diff-merges-more (was Re: What's cooking in git.git (Feb 2023, #01; Thu, 2)) Glen Choo
2023-02-07 12:50     ` Sergey Organov
2023-03-02  0:37       ` Glen Choo [this message]
2023-03-02 16:15         ` Junio C Hamano
2023-03-02 16:57           ` Sergey Organov
2023-03-06 22:22             ` Glen Choo
2023-03-07 10:02               ` Sergey Organov
2023-03-07 17:54                 ` Junio C Hamano
2023-03-08 22:19                   ` Sergey Organov
2023-03-08 23:08                     ` Junio C Hamano
2023-03-09 13:54                       ` Sergey Organov
2023-03-09 17:43                         ` Glen Choo
2023-03-09 19:56                           ` Sergey Organov
2023-03-10 21:19                             ` Glen Choo
2023-03-10 21:47                             ` Junio C Hamano
2023-03-17 14:18                               ` Sergey Organov
2023-03-18  0:08                                 ` Junio C Hamano
2023-03-25 16:55                                   ` Sergey Organov
2023-03-29  7:43                                     ` Sergey Organov
2023-03-29  8:06                                     ` Sergey Organov
2023-02-08 17:22 ` ds/bundle-uri-5 (was: " Victoria Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=kl6lh6v43s4g.fsf@chooglen-macbookpro.roam.corp.google.com \
    --to=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sorganov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.