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@xxxxxxxxx> 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