git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Denton Liu <liu.denton@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Why isn't 'jch' based on 'next'?
Date: Thu, 15 Apr 2021 11:24:25 -0700	[thread overview]
Message-ID: <xmqqlf9jqucm.fsf@gitster.g> (raw)
In-Reply-To: <YHgDYl3cMx9+Hqa7@generichostname> (Denton Liu's message of "Thu, 15 Apr 2021 02:12:02 -0700")

Denton Liu <liu.denton@gmail.com> writes:

> Out of curiosity, why is 'jch' not based on 'next' but instead, it
> recreates the same merge commits on top of 'master'. What is the
> advantage of this?

The 'jch' point is merely a convenient "I personally have no problem
using this tree" point on 'seen', so I'll talk about 'seen'.

It is the second or third time I answer this exact question, and we
should add the answer to Documentation/howto/maintain-git.txt (or
MaintNotes on the todo branch), perhaps.

The history of 'next' can become quite messy due to many reasons:

 - A topic that has already been merged to 'next' but not graduated
   to 'master' may need some fix-up, in which case, 'next' will have
   another merge of the same topic into it.

 - A mismerge of a topic into 'next' may be discovered long after it
   happened, and a single-parent commit is made directly on 'next'
   to correct it.

 - When 'master' advances, it is merged back to 'next'.

 - A topic that looked promising may turn out to be a bad idea and
   the merge of the topic into 'next' get reverted out of 'next'.

 - A topic that looked nice may want to do a wholesale replacement,
   not an incremental refinement, and a merge of the topic into
   'next' get reverted and then the newer iteration of the topic
   gets merged to 'next' (this last case is rare, but it sometimes
   happens, like once every few cycles).

But we know which topic must be in 'next' all the time.  You can ask
'seen' which ones they are:

   $ git log --oneline --first-parent 'master..seen^{/^### match next}'

So if we reset 'seen' at 'master' and merge the tip of these topics
into it, the tree of the empty commit that is marked with "### match
next" marker should match the tree of 'next', or something is still
wrong (most likely, a mismerge).  Also, the order topics are merged
into 'next' may not be necessarily the order they appear in 'seen'.
Every time I rebuild 'seen' from 'master', I have a chance to reorder
these topics so that the ones that are expected to graduate sooner
come near the bottom.

By ensuring "### match next" and 'next' matches, even though they
came to their trees in different route, I can spot a mismerge that
is waiting to happen soon when a topic graduates to 'master'.

  reply	other threads:[~2021-04-15 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  9:12 Why isn't 'jch' based on 'next'? Denton Liu
2021-04-15 18:24 ` Junio C Hamano [this message]
2021-04-15 19:46   ` Junio C Hamano

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=xmqqlf9jqucm.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@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 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 NNTP newsgroup(s).