git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, peff@peff.net, me@ttaylorr.com,
	Derrick Stolee <dstolee@microsoft.com>,
	"brian m. carlson" <sandals@crustytoothpaste.net>
Subject: Re: [PATCH] revision: --include-diversions adds helpful merges
Date: Wed, 8 Apr 2020 11:28:53 -0400	[thread overview]
Message-ID: <74562b04-b1ce-cad4-da18-4af030a3dc29@gmail.com> (raw)
In-Reply-To: <5f1c6868-303c-ccc1-553e-e54d0fa8e24f@gmail.com>

On 4/7/2020 9:39 PM, Derrick Stolee wrote:
> On 4/7/2020 9:30 PM, Junio C Hamano wrote:
>> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>
>>>     This --include-diversions option could use a better name.
>>
>> True, but I do not think of a better (or for that matter a worse)
>> one.  

Here are some alternative names:

	--audit-merges
	--audit-trunk
	--first-merges
	--subtle-merges
	--more-merges

The "audit" name implies some of the intent: we are trying to
audit which merge commits introduced these changes. The --audit-trunk
implies we are using a trunk-based workflow where parent order is
critical. However, "trunk" may be confusing when there are multiple
long-lived branches.

A "first merge" is confusing when we see a sequence of multiple
diversion merges (I include a test with this exact situation in
my next version.)

"subtle" is a bit wishy-washy.

"--more-merges" is not very specific. The way we are adding
merges to the final result may not be the only way we want to
add "more" merges in the future.

So, I think "--audit-merges" is the best of these alternatives.
I'd be happy to be overruled with a different option. Hopefully,
these options inspire better ideas from the community.

>> As a new feature, I think this is a reasonable thing to want,
>> especially it is in line with the push in the past few years to
>> treat the first parent history specially.
>>
>> I wonder how this would interact with the ancestry-path option?
>> That one also, like the simplify-merges option, needs a limited
>> traversal, and if this new mode can do without a limited traversal
>> (in other words, the output can be done incrementally from the tip)
>> and achieve something similar to what these other options wanted to
>> show, that would be great.
> 
> You're right. I briefly considered the --ancestry-path option before
> realizing that would get a huge set of commits (for example: every
> topic based on the branch after the pull request was merged).
> 
> The --include-diversions works incrementally like simplified merges.
> Based on the implementation, it would not change the results when
> added to a --full-history query. This makes sense: a diversion would
> appear in the --full-history results, anyway.
> 
> It is worth adding tests for the combination with --ancestry-path
> and --simplify-merges, as the --include-diversions option would
> add results to those queries.

My gitgitgadget PR [1] is updated with tests and some new logic to
handle the new option along with --simplify-merges. The situation was
a bit subtle, so my next version will include a significant update to
the rev-list documentation under the "History Simplification" mode.

I'll give things some time to calm on the name of the option before
sending a v2.

My v2 also includes adding a new object flag "DIVERSION" to track
these commits from the TREESAME calculation through the simplify-merges
logic. When I was adding a new flag, I realized that I already
messed up the 32-bit alignment of "struct object" when adding the
TOPO_ORDER flags. The parsed, type, and flags bitfields add up to
33 bits!

A solution would include pulling the TOPO_ORDER_* flags to be bits
22 and 23 instead of 26 and 27, but that would collide with what is
happening in builtin/show-branch.c. But then I saw the following
comment in builtin/show-branch.c:

/*
 * TODO: convert this use of commit->object.flags to commit-slab
 * instead to store a pointer to ref name directly. Then use the same
 * UNINTERESTING definition from revision.h here.
 */

Is anyone interested in tackling this problem? I don't see any
test failures when I swap the TOPO_ORDER_ flag locations, but
that might just mean that show-branch isn't tested enough.

Thanks,
-Stolee

[1] https://github.com/gitgitgadget/git/pull/599

  reply	other threads:[~2020-04-08 15:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08  1:22 Derrick Stolee via GitGitGadget
2020-04-08  1:30 ` Junio C Hamano
2020-04-08  1:39   ` Derrick Stolee
2020-04-08 15:28     ` Derrick Stolee [this message]
2020-04-08 19:46       ` Junio C Hamano
2020-04-08 20:05         ` Jeff King
2020-04-08 20:22           ` Derrick Stolee
2020-04-08 21:35             ` Junio C Hamano
2020-04-08 23:59               ` Derrick Stolee
2020-04-09  0:08                 ` Junio C Hamano
2020-04-09 11:52                   ` Derrick Stolee
2020-04-09 14:28                   ` Philip Oakley
2020-04-09 15:56                     ` Junio C Hamano
2020-04-09 17:20                       ` Derrick Stolee
2020-04-09 18:24                         ` Jeff King
2020-04-09 18:55                           ` Junio C Hamano
2020-04-09 19:21                             ` Jeff King
2020-04-08  2:13 ` brian m. carlson
2020-04-08 18:48 ` Jeff King
2020-04-09  0:01 ` [PATCH v2] " Derrick Stolee via GitGitGadget
2020-04-10 12:19   ` [PATCH v3] revision: --show-pulls " Derrick Stolee via GitGitGadget
2020-04-10 20:06     ` Junio C Hamano
2020-04-10 21:43       ` Derrick Stolee

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=74562b04-b1ce-cad4-da18-4af030a3dc29@gmail.com \
    --to=stolee@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    /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 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).