git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Tao Klerks <tao@klerks.biz>
To: Alex Henrie <alexhenrie24@gmail.com>
Cc: Elijah Newren <newren@gmail.com>,
	Tao Klerks via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"
Date: Tue, 21 Feb 2023 16:40:04 +0100	[thread overview]
Message-ID: <CAPMMpohfF5Cwgxt_G+Gp4rNPGTJZcQfmgEoJcFi_Kzbv2XGuog@mail.gmail.com> (raw)
In-Reply-To: <CAMMLpeSZs8DqrN6_F9-eg7fcbjV-O5+3V+hUsOhyd0x10xsCaQ@mail.gmail.com>

On Mon, Feb 20, 2023 at 7:33 PM Alex Henrie <alexhenrie24@gmail.com> wrote:
>
> Tao, the primary motivation behind the `git pull` warning was to help
> prevent users from merging main into a topic branch when that's not
> what they really want to do. The fact that novices sometimes do that
> has been a point of pain for many people, including Linus Torvalds:
> See "Don't merge upstream code at random points" at [1] and "github
> creates absolutely useless garbage merges" at [2].
>
> If you're seeing users merge main into topic branches without a good
> reason, that does sound like more of an education problem than a
> bad-defaults problem.

I would disagree on two points:

1. The need for merging in the upstream varies project by project,
user by user, etc. If you are working on a part of a system where you
can reasonably assume the ground will not shift under your feet,
awesome, lucky you! Many users are not so fortunate, and need to
regularly ensure that their changes still make sense in the
ever-changing upstream context.

Regularly (whatever that means to you) merging in the upstream is the
simplest way of achieving that. If you're working on your own or as
part of a team that's happy to handle coordinated rebasing, then
rebasing is a potentially-more-satisfying way of achieving the same
end - either way, assuming that their changes will make sense in the
upstream context is simply not a luxury many users can afford over any
period of time.

Now, you note that Linus advocates for merging specific points,
because he doesn't respect you merging "random crap" from a branch
called "linus" - that's fine, but many projects strive to keep a
specific trunk branch "evergreen" in order to minimize late conflicts
are maximize coordination - there's a pretty cool site about it:
https://trunkbaseddevelopment.com/ - this is not really different to
Linus' advice except that the goal is to make there *never* be "random
crap" on the upstream.

2. The fact that the commit history of non-expert git users (those who
should not be using rebase, especially in teams) are so often...
spidery... is why the "Squash" option of pull requests / merge
requests is so popular in centralized workflows (GitHub, GitLab,
BitBucket, etc).

If your project follows a "merge down, squash up" strategy with a
well-CI-guarded evergreen trunk on a central server, there's simply no
reason to *require* your users to become rebasing experts - you can
let them use simple merge-based workflows, keep your trunk clean by
squashing away their complex commit graphs, let them merge down
whenever they need or want to, etc.


> We might still want to change the default to
> better support the more unusual cases, but

Do we have any analysis/understanding of how common workflows like
that of the git or linux projects are, vs github-style fork-based
projects, vs straight-up single central server projects?

I'm not sure what you mean by "unusual", but I don't think "avoid
rebase unless you really know what you're doing, merge down at will,
we will squash your contribution in the pull/merge request at the end
anyway" is an unusual flow at all nowadays.

> if you're going for a quick
> win, it would be faster to teach users the wisdom of not mixing rebase
> and merge in the first place.
>

"teach [...] wisdom" is a good one! No, seriously - of course I'm
going to do the best I can to prevent my users from falling into the
traps surrounding them - but my point here is that *we simply
shouldn't have pointless traps*. Offering a command that can cause
significant "harm" (time loss, frustration, etc), silently... just
doesn't seem like a good idea.


> [1] https://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html
> [2] https://lore.kernel.org/lkml/CAHk-=wjbtip559HcMG9VQLGPmkurh5Kc50y5BceL8Q8=aL0H3Q@mail.gmail.com/

  reply	other threads:[~2023-02-21 15:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-05 16:24 [PATCH] pull: conflict hint pull.rebase suggestion should offer "merges" vs "true" Tao Klerks via GitGitGadget
2023-02-16  3:22 ` Alex Henrie
2023-02-16 12:31   ` Tao Klerks
2023-02-17  3:15     ` Alex Henrie
2023-02-17 11:15       ` Tao Klerks
2023-02-17 18:56         ` Alex Henrie
2023-02-17 17:39       ` Junio C Hamano
2023-02-18  3:17       ` Elijah Newren
2023-02-18 16:39         ` Phillip Wood
2023-02-20  8:03           ` Tao Klerks
2023-02-20 16:45             ` Phillip Wood
2023-02-20 16:56             ` Elijah Newren
2023-02-21 14:04               ` Tao Klerks
2023-02-22 14:27             ` Sergey Organov
2023-02-24  7:06               ` Elijah Newren
2023-02-24 22:06                 ` Sergey Organov
2023-02-24 23:59                   ` Elijah Newren
2023-02-25 15:15                     ` Sergey Organov
2023-02-25 16:28                       ` Elijah Newren
2023-02-26  9:29                         ` Sergey Organov
2023-02-27 15:20                           ` Elijah Newren
2023-02-27 17:17                             ` Sergey Organov
2023-02-28  2:35                               ` Elijah Newren
2023-02-20 16:46           ` Elijah Newren
2023-02-20  6:01         ` Tao Klerks
2023-02-20 17:20           ` Elijah Newren
2023-02-20 18:33             ` Alex Henrie
2023-02-21 15:40               ` Tao Klerks [this message]
2023-02-21 17:45                 ` Alex Henrie
2023-02-21 15:01             ` Tao Klerks
2023-02-24  7:06               ` Elijah Newren
2023-02-28 14:13     ` Felipe Contreras
2023-02-28 20:04       ` Alex Henrie
2023-03-01 12:46         ` Felipe Contreras

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAPMMpohfF5Cwgxt_G+Gp4rNPGTJZcQfmgEoJcFi_Kzbv2XGuog@mail.gmail.com \
    --to=tao@klerks.biz \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=alexhenrie24@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).