mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-28 07:20:11 +00:00
fb33620f9e
The original idea was similar to Mercurial's "topo" sorting, but it was bad at handling merge-heavy history. In order to render merges of topic branches nicely, we need to prioritize branches at merge point, not at fork point. OTOH, we do also want to place unmerged branches as close to the fork point as possible. This commit implements the former requirement, and the latter will be addressed by the next commit. I think this is similar to Git's sorting logic described in the following blog post. In our case, the in-degree walk can be dumb since topological order is guaranteed by the index. We keep HashSet<CommitId> instead of an in-degree integer value, which will be used in the next commit to resolve new heads as late as possible. https://github.blog/2022-08-30-gits-database-internals-ii-commit-history-queries/#topological-sorting Compared to Sapling's beautify_graph(), this is lazy, and can roughly preserve the index (or chronological) order. I tried beautify_graph() with prioritizing the @ commit, but the result seemed too aggressively reordered. Perhaps, for more complex history, beautify_graph() would produce a better result. For my wip branches (~30 branches, a couple of commits per branch), this works pretty well. #242 |
||
---|---|---|
.. | ||
common | ||
test_abandon_command.rs | ||
test_alias.rs | ||
test_branch_command.rs | ||
test_cat_command.rs | ||
test_checkout.rs | ||
test_chmod_command.rs | ||
test_commit_command.rs | ||
test_commit_template.rs | ||
test_concurrent_operations.rs | ||
test_config_command.rs | ||
test_debug_command.rs | ||
test_describe_command.rs | ||
test_diff_command.rs | ||
test_diffedit_command.rs | ||
test_duplicate_command.rs | ||
test_edit_command.rs | ||
test_git_clone.rs | ||
test_git_colocated.rs | ||
test_git_fetch.rs | ||
test_git_import_export.rs | ||
test_git_push.rs | ||
test_git_remotes.rs | ||
test_git_submodule.rs | ||
test_gitignores.rs | ||
test_global_opts.rs | ||
test_init_command.rs | ||
test_interdiff_command.rs | ||
test_log_command.rs | ||
test_move_command.rs | ||
test_new_command.rs | ||
test_obslog_command.rs | ||
test_operations.rs | ||
test_rebase_command.rs | ||
test_resolve_command.rs | ||
test_restore_command.rs | ||
test_revset_output.rs | ||
test_show_command.rs | ||
test_sparse_command.rs | ||
test_split_command.rs | ||
test_squash_command.rs | ||
test_status_command.rs | ||
test_templater.rs | ||
test_undo.rs | ||
test_unsquash_command.rs | ||
test_untrack_command.rs | ||
test_util_command.rs | ||
test_workspaces.rs |