ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/cli/tests
Yuya Nishihara f169c99fb4 cli: add "op abandon root..head" command that "reparents" operations
In order to implement GC (#12), we'll need to somehow prune old operations.
Perhaps the easiest implementation is to just remove unwanted operation files
and put tombstone file instead (like git shallow.) However, the removed
operations might be referenced by another jj process running in parallel. Since
the parallel operation thinks all the historical head commits are reachable, the
removed operations would have to be resurrected (or fix up index data, etc.)
when the op heads get merged.

The idea behind this patch is to split the "op log" GC into two steps:
 1. recreate operations to be retained and make the old history unreachable,
 2. delete unreachable operations if the head was created e.g. 3 days ago.
The latter will be run by "jj util gc". I don't think GC can be implemented
100% safe against lock-less append-only storage, and we'll probably need some
timestamp-based mechanism to not remove objects that might be referenced by
uncommitted operation.

FWIW, another nice thing about this implementation is that the index is
automatically invalidated as the op id changes. The bad thing is that the
"undo" description would contain an old op id. It seems the performance is
pretty okay.
2024-01-04 11:44:36 +09:00
..
common cli rebase -r: add tests for weird ancestry, record a bug, fix a comment 2023-11-28 21:36:51 -08:00
test_abandon_command.rs test_abandon_command: create another test for bug 2600 2023-12-01 17:03:44 -08:00
test_alias.rs cli: don't panic on empty alias substitution 2023-12-24 23:31:28 +09:00
test_branch_command.rs tests: set git_settings.auto_local_branch where it matters 2023-12-17 08:30:24 +09:00
test_builtin_aliases.rs tests: set git_settings.auto_local_branch where it matters 2023-12-17 08:30:24 +09:00
test_cat_command.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_checkout.rs cli templates: include info on divergent change ids in short commit template 2023-10-26 17:58:13 -07:00
test_chmod_command.rs cli: print a hint about how to resolve conflicts 2023-12-10 12:44:57 -08:00
test_commit_command.rs clippy: fix new issues spotted by nightly version 2023-11-16 10:20:07 -08:00
test_commit_template.rs tests: set git_settings.auto_local_branch where it matters 2023-12-17 08:30:24 +09:00
test_concurrent_operations.rs merge: simply generate content hash from interleaved values 2023-11-06 07:21:06 +09:00
test_config_command.rs cli: allow overwriting non-scalar with jj config set 2023-10-11 07:40:08 -07:00
test_debug_command.rs merge: simply generate content hash from interleaved values 2023-11-06 07:21:06 +09:00
test_describe_command.rs clippy: run cargo clippy --fix --workspace with recent nightly 2023-10-29 20:19:44 -07:00
test_diff_command.rs clippy: fix new issues spotted by nightly version 2023-11-16 10:20:07 -08:00
test_diffedit_command.rs cli: send status messages to stderr, specify stdout/stderr explicitly 2023-10-11 19:24:01 +09:00
test_duplicate_command.rs cli: send status messages to stderr, specify stdout/stderr explicitly 2023-10-11 19:24:01 +09:00
test_edit_command.rs git_backend: replace git2::Repository with gix::Repository 2023-11-02 19:33:06 +09:00
test_git_clone.rs tests: set git_settings.auto_local_branch where it matters 2023-12-17 08:30:24 +09:00
test_git_colocated.rs tests: set git_settings.auto_local_branch where it matters 2023-12-17 08:30:24 +09:00
test_git_fetch.rs git: turn git.auto-local-branch off by default 2023-12-17 08:30:24 +09:00
test_git_import_export.rs cli: print failed git export reason for each ref 2023-12-09 23:37:00 +09:00
test_git_push.rs tests: set git_settings.auto_local_branch where it matters 2023-12-17 08:30:24 +09:00
test_git_remotes.rs tests: don't create new branch by "jj branch set" 2023-11-11 07:03:31 +09:00
test_git_submodule.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_gitignores.rs cli: send status messages to stderr, specify stdout/stderr explicitly 2023-10-11 19:24:01 +09:00
test_global_opts.rs cli: error out early if -R path is invalid 2023-12-24 00:20:38 +09:00
test_immutable_commits.rs immutable commits: remove the hint if trying to edit the root commit 2023-10-29 21:13:39 -07:00
test_init_command.rs tests: set git_settings.auto_local_branch where it matters 2023-12-17 08:30:24 +09:00
test_interdiff_command.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_log_command.rs tests: don't create new branch by "jj branch set" 2023-11-11 07:03:31 +09:00
test_move_command.rs cli: send status messages to stderr, specify stdout/stderr explicitly 2023-10-11 19:24:01 +09:00
test_new_command.rs cli new: have --no-edit print description of the new commit 2023-11-23 11:15:38 -08:00
test_next_prev_commands.rs tests: don't create new branch by "jj branch set" 2023-11-11 07:03:31 +09:00
test_obslog_command.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_operations.rs cli: add "op abandon root..head" command that "reparents" operations 2024-01-04 11:44:36 +09:00
test_rebase_command.rs cli rebase: tests for weird ancestry for -s and -b 2023-11-28 21:36:51 -08:00
test_repo_change_report.rs cli: print a hint about how to resolve conflicts 2023-12-10 12:44:57 -08:00
test_resolve_command.rs cli: print a hint about how to resolve conflicts 2023-12-10 12:44:57 -08:00
test_restore_command.rs cli: print a hint about how to resolve conflicts 2023-12-10 12:44:57 -08:00
test_revset_output.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_show_command.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_sparse_command.rs cli: send status messages to stderr, specify stdout/stderr explicitly 2023-10-11 19:24:01 +09:00
test_split_command.rs test_split_command: check that new commits inherit author dates 2023-12-24 19:25:16 -08:00
test_squash_command.rs cli: send status messages to stderr, specify stdout/stderr explicitly 2023-10-11 19:24:01 +09:00
test_status_command.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_templater.rs tests: migrate most tests from test_templater.rs 2023-10-27 05:30:53 +09:00
test_tree_level_conflicts.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_undo.rs cli: remove weird line break from the "jj branch forget" hint 2023-12-16 07:50:15 +09:00
test_unsquash_command.rs cli: send status messages to stderr, specify stdout/stderr explicitly 2023-10-11 19:24:01 +09:00
test_untrack_command.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_util_command.rs tests: move tests/ under cli/ so they're run again 2023-08-05 06:18:59 +00:00
test_working_copy.rs tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
test_workspaces.rs merge: simply generate content hash from interleaved values 2023-11-06 07:21:06 +09:00