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

Re: [PATCH] merge: refuse to create too cool a merge by default

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 6, 2016, 18:55 UTC
Message-ID
<CA+55aFy-mb00=KGWghx5XXfkv5dChnncoLoJA07f_2Y_or0FOw@mail.gmail.com>
In-Reply-To
<xmqqwpoawpmq.fsf@gitster.mtv.corp.google.com>
On Wed, Apr 6, 2016 at 11:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>
> I was reviewing the topics to merge to 'master', and a thought
> crossed my mind.  Both of our series only refuse to create a merge
> that does not have any common ancestor, but shouldn't the right
> solution refuse to add a new root?

So I think that's an independent thing, and I think you're right, it would be a good feature to have. As a maintainer, it would have caught the whole "my submaintainers did something really odd, I need to talk to them" before-the-fact rather than after-the-fact.

That said, I'm less worried about my submaintainers doing _intentionally_ annoying things, than people doing silly things by mistake.

So if I had a version of git that allowed me to say "don't allow pulls that add a new root commit unless I specify a '--new-root-allowed' flag", then yes, I'd use that. And I guess it might not be too nasty to add: it could be done as part of the object checking pass after downloading the pack. Was that what you were thinking of?

But at the same time, I think the existing series you have, which hopefully results in these things not happening by mistake in the future is the more important piece. I'd rather get good pull requests than get errors and have to tell people "you screwed up, now we'll need to re-do this".

But if you cook something up that checks that there are no new roots in the pull, I'd certainly appreciate that safety net.

               Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 10 in “merge: refuse to create too cool a merge by default”
  1. merge: refuse to create too cool a merge by defaultJunio C Hamano, Mar 18, 2016
  2. Linus TorvaldsMar 18, 2016
  3. Junio C HamanoMar 18, 2016
  4. Junio C HamanoApr 6, 2016
  5. Linus TorvaldsApr 6, 2016
  6. Junio C HamanoApr 6, 2016
  7. Eric SunshineMar 18, 2016
  8. Ramsay JonesMar 18, 2016
  9. David TurnerMar 18, 2016
  10. Junio C HamanoMar 18, 2016

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.