git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Why isn't 'jch' based on 'next'?
@ 2021-04-15  9:12 Denton Liu
  2021-04-15 18:24 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Denton Liu @ 2021-04-15  9:12 UTC (permalink / raw)
  To: gitster; +Cc: git

Hi Junio,

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?

Thanks,
Denton

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why isn't 'jch' based on 'next'?
  2021-04-15  9:12 Why isn't 'jch' based on 'next'? Denton Liu
@ 2021-04-15 18:24 ` Junio C Hamano
  2021-04-15 19:46   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2021-04-15 18:24 UTC (permalink / raw)
  To: Denton Liu; +Cc: git

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'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why isn't 'jch' based on 'next'?
  2021-04-15 18:24 ` Junio C Hamano
@ 2021-04-15 19:46   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2021-04-15 19:46 UTC (permalink / raw)
  To: Denton Liu; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> 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.

This is so that I can "git checkout seen~40" (or whereever point
that has all the topics scheduled to be in 'master' and nothing
else) and run tests, to simulate what happens if these topics
graduate to 'master'.

> 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'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-15 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15  9:12 Why isn't 'jch' based on 'next'? Denton Liu
2021-04-15 18:24 ` Junio C Hamano
2021-04-15 19:46   ` Junio C Hamano

Code repositories for project(s) associated with this 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).