ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: rename obslog to evolution-log/evolog

It seems everyone agrees that `obslog` is not an intuitive name. There
was some discussion about alternatives in #3592 and on #4146. The
alternatives included `evolution`, `evolutionlog`, `evolog`,
`rewritelog`, `revlog`, and `changelog`. It seemed like
`evolution-log`/`evolog` was the most popular option. That also
matches the command's current help text ("Show how a change has
evolved over time").
This commit is contained in:
Martin von Zweigbergk 2024-07-24 06:49:18 -07:00 committed by Martin von Zweigbergk
parent e8d7909526
commit a0fae76622
15 changed files with 86 additions and 86 deletions

View file

@ -13,6 +13,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Deprecations
* `jj obslog` is now called `jj evolution-log`/`jj evolog`. `jj obslog` remains
as an alias.
### New features
### Fixed bugs

View file

@ -37,10 +37,8 @@ use crate::ui::Ui;
///
/// Lists the previous commits which a change has pointed to. The current commit
/// of a change evolves when the change is updated, rebased, etc.
///
/// Name is derived from Merciual's obsolescence markers.
#[derive(clap::Args, Clone, Debug)]
pub(crate) struct ObslogArgs {
pub(crate) struct EvologArgs {
#[arg(long, short, default_value = "@")]
revision: RevisionArg,
/// Limit number of revisions to show
@ -74,10 +72,10 @@ pub(crate) struct ObslogArgs {
}
#[instrument(skip_all)]
pub(crate) fn cmd_obslog(
pub(crate) fn cmd_evolog(
ui: &mut Ui,
command: &CommandHelper,
args: &ObslogArgs,
args: &EvologArgs,
) -> Result<(), CommandError> {
let workspace_command = command.workspace_helper(ui)?;
let repo = workspace_command.repo().as_ref();

View file

@ -28,7 +28,7 @@ use crate::ui::Ui;
///
/// This excludes changes from other commits by temporarily rebasing `--from`
/// onto `--to`'s parents. If you wish to compare the same change across
/// versions, consider `jj obslog -p` instead.
/// versions, consider `jj evolog -p` instead.
#[derive(clap::Args, Clone, Debug)]
#[command(group(ArgGroup::new("to_diff").args(&["from", "to"]).multiple(true).required(true)))]
pub(crate) struct InterdiffArgs {

View file

@ -26,6 +26,7 @@ mod diff;
mod diffedit;
mod duplicate;
mod edit;
mod evolog;
mod file;
mod fix;
mod git;
@ -36,7 +37,6 @@ mod merge;
mod r#move;
mod new;
mod next;
mod obslog;
mod operation;
mod parallelize;
mod prev;
@ -96,6 +96,8 @@ enum Command {
Diffedit(diffedit::DiffeditArgs),
Duplicate(duplicate::DuplicateArgs),
Edit(edit::EditArgs),
#[command(alias = "obslog", visible_alias = "evolution-log")]
Evolog(evolog::EvologArgs),
#[command(subcommand)]
File(file::FileCommand),
/// List files in a revision (DEPRECATED use `jj file list`)
@ -123,7 +125,6 @@ enum Command {
Move(r#move::MoveArgs),
New(new::NewArgs),
Next(next::NextArgs),
Obslog(obslog::ObslogArgs),
#[command(subcommand)]
#[command(visible_alias = "op")]
Operation(operation::OperationCommand),
@ -213,7 +214,7 @@ pub fn run_command(ui: &mut Ui, command_helper: &CommandHelper) -> Result<(), Co
Command::Move(args) => r#move::cmd_move(ui, command_helper, args),
Command::New(args) => new::cmd_new(ui, command_helper, args),
Command::Next(args) => next::cmd_next(ui, command_helper, args),
Command::Obslog(args) => obslog::cmd_obslog(ui, command_helper, args),
Command::Evolog(args) => evolog::cmd_evolog(ui, command_helper, args),
Command::Operation(args) => operation::cmd_operation(ui, command_helper, args),
Command::Parallelize(args) => parallelize::cmd_parallelize(ui, command_helper, args),
Command::Prev(args) => prev::cmd_prev(ui, command_helper, args),

View file

@ -646,7 +646,7 @@ fn builtin_commit_methods<'repo>() -> CommitTemplateBuildMethodFnMap<'repo, Comm
function.expect_no_arguments()?;
let repo = language.repo;
let out_property = self_property.map(|commit| {
// The given commit could be hidden in e.g. obslog.
// The given commit could be hidden in e.g. `jj evolog`.
let maybe_entries = repo.resolve_change_id(commit.change_id());
maybe_entries.map_or(0, |entries| entries.len()) > 1
});

View file

@ -35,6 +35,7 @@ This document contains the help content for the `jj` command-line program.
* [`jj diffedit`↴](#jj-diffedit)
* [`jj duplicate`↴](#jj-duplicate)
* [`jj edit`↴](#jj-edit)
* [`jj evolog`↴](#jj-evolog)
* [`jj file`↴](#jj-file)
* [`jj file chmod`↴](#jj-file-chmod)
* [`jj file list`↴](#jj-file-list)
@ -59,7 +60,6 @@ This document contains the help content for the `jj` command-line program.
* [`jj log`↴](#jj-log)
* [`jj new`↴](#jj-new)
* [`jj next`↴](#jj-next)
* [`jj obslog`↴](#jj-obslog)
* [`jj operation`↴](#jj-operation)
* [`jj operation abandon`↴](#jj-operation-abandon)
* [`jj operation diff`↴](#jj-operation-diff)
@ -120,6 +120,7 @@ To get started, see the tutorial at https://github.com/martinvonz/jj/blob/main/d
* `diffedit` — Touch up the content changes in a revision with a diff editor
* `duplicate` — Create a new change with the same content as an existing one
* `edit` — Sets the specified revision as the working-copy revision
* `evolog` — Show how a change has evolved over time
* `file` — File operations
* `fix` — Update files with formatting fixes or other changes
* `git` — Commands for working with Git remotes and the underlying Git repo
@ -128,7 +129,6 @@ To get started, see the tutorial at https://github.com/martinvonz/jj/blob/main/d
* `log` — Show revision history
* `new` — Create a new, empty change and (by default) edit it in the working copy
* `next` — Move the working-copy commit to the child revision
* `obslog` — Show how a change has evolved over time
* `operation` — Commands for working with the operation log
* `parallelize` — Parallelize revisions by making them siblings
* `prev` — Change the working copy revision relative to the parent revision
@ -692,6 +692,42 @@ For more information, see https://martinvonz.github.io/jj/latest/FAQ#how-do-i-re
## `jj evolog`
Show how a change has evolved over time
Lists the previous commits which a change has pointed to. The current commit of a change evolves when the change is updated, rebased, etc.
**Usage:** `jj evolog [OPTIONS]`
###### **Options:**
* `-r`, `--revision <REVISION>`
Default value: `@`
* `-n`, `--limit <LIMIT>` — Limit number of revisions to show
* `--no-graph` — Don't show the graph, show a flat list of revisions
* `-T`, `--template <TEMPLATE>` — Render each revision using the given template
For the syntax, see https://github.com/martinvonz/jj/blob/main/docs/templates.md
* `-p`, `--patch` — Show patch compared to the previous version of this change
If the previous version has different parents, it will be temporarily rebased to the parents of the new version, so the diff is not contaminated by unrelated changes.
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `--types` — For each path, show only its type before and after
The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
* `--name-only` — For each path, show only its path
Typically useful for shell commands like: `jj diff -r @- --name_only | xargs perl -pi -e's/OLD/NEW/g`
* `--git` — Show a Git-format diff
* `--color-words` — Show a word-level diff with changes indicated only by color
* `--tool <TOOL>` — Generate diff by external command
* `--context <CONTEXT>` — Number of lines of context to show
## `jj file`
File operations
@ -1105,7 +1141,7 @@ If the given directory does not exist, it will be created. If no directory is gi
Compare the changes of two commits
This excludes changes from other commits by temporarily rebasing `--from` onto `--to`'s parents. If you wish to compare the same change across versions, consider `jj obslog -p` instead.
This excludes changes from other commits by temporarily rebasing `--from` onto `--to`'s parents. If you wish to compare the same change across versions, consider `jj evolog -p` instead.
**Usage:** `jj interdiff [OPTIONS] <--from <FROM>|--to <TO>> [PATHS]...`
@ -1253,44 +1289,6 @@ implied.
## `jj obslog`
Show how a change has evolved over time
Lists the previous commits which a change has pointed to. The current commit of a change evolves when the change is updated, rebased, etc.
Name is derived from Merciual's obsolescence markers.
**Usage:** `jj obslog [OPTIONS]`
###### **Options:**
* `-r`, `--revision <REVISION>`
Default value: `@`
* `-n`, `--limit <LIMIT>` — Limit number of revisions to show
* `--no-graph` — Don't show the graph, show a flat list of revisions
* `-T`, `--template <TEMPLATE>` — Render each revision using the given template
For the syntax, see https://github.com/martinvonz/jj/blob/main/docs/templates.md
* `-p`, `--patch` — Show patch compared to the previous version of this change
If the previous version has different parents, it will be temporarily rebased to the parents of the new version, so the diff is not contaminated by unrelated changes.
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `--types` — For each path, show only its type before and after
The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
* `--name-only` — For each path, show only its path
Typically useful for shell commands like: `jj diff -r @- --name_only | xargs perl -pi -e's/OLD/NEW/g`
* `--git` — Show a Git-format diff
* `--color-words` — Show a word-level diff with changes indicated only by color
* `--tool <TOOL>` — Generate diff by external command
* `--context <CONTEXT>` — Number of lines of context to show
## `jj operation`
Commands for working with the operation log

View file

@ -27,6 +27,7 @@ mod test_diff_command;
mod test_diffedit_command;
mod test_duplicate_command;
mod test_edit_command;
mod test_evolog_command;
mod test_file_chmod_command;
mod test_file_print_command;
mod test_file_untrack_command;
@ -50,7 +51,6 @@ mod test_log_command;
mod test_move_command;
mod test_new_command;
mod test_next_prev_commands;
mod test_obslog_command;
mod test_operations;
mod test_parallelize_command;
mod test_rebase_command;

View file

@ -431,7 +431,7 @@ fn test_log_builtin_templates_colored_debug() {
}
#[test]
fn test_log_obslog_divergence() {
fn test_log_evolog_divergence() {
let test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
let repo_path = test_env.env_root().join("repo");
@ -473,8 +473,8 @@ fn test_log_obslog_divergence() {
 zzzzzzzz root() 00000000
"###);
// Obslog and hidden divergent
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog"]);
// Evolog and hidden divergent
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog"]);
insta::assert_snapshot!(stdout, @r###"
@ qpvuntsm?? test.user@example.com 2001-02-03 08:05:08 ff309c29
description 1
@ -484,8 +484,8 @@ fn test_log_obslog_divergence() {
(empty) (no description set)
"###);
// Colored obslog
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--color=always"]);
// Colored evolog
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog", "--color=always"]);
insta::assert_snapshot!(stdout, @r###"
@ qpvuntsm?? test.user@example.com 2001-02-03 08:05:08 ff309c29
description 1

View file

@ -16,7 +16,7 @@ use crate::common::get_stdout_string;
use crate::common::TestEnvironment;
#[test]
fn test_obslog_with_or_without_diff() {
fn test_evolog_with_or_without_diff() {
let test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
let repo_path = test_env.env_root().join("repo");
@ -28,7 +28,7 @@ fn test_obslog_with_or_without_diff() {
test_env.jj_cmd_ok(&repo_path, &["rebase", "-r", "@", "-d", "root()"]);
std::fs::write(repo_path.join("file1"), "resolved\n").unwrap();
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog"]);
insta::assert_snapshot!(stdout, @r###"
@ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3
my description
@ -41,7 +41,7 @@ fn test_obslog_with_or_without_diff() {
"###);
// Color
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "obslog"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["--color=always", "evolog"]);
insta::assert_snapshot!(stdout, @r###"
@ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3
my description
@ -55,7 +55,7 @@ fn test_obslog_with_or_without_diff() {
// There should be no diff caused by the rebase because it was a pure rebase
// (even even though it resulted in a conflict).
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "-p"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog", "-p"]);
insta::assert_snapshot!(stdout, @r###"
@ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3
my description
@ -81,7 +81,7 @@ fn test_obslog_with_or_without_diff() {
"###);
// Test `--limit`
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--limit=2"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog", "--limit=2"]);
insta::assert_snapshot!(stdout, @r###"
@ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3
my description
@ -90,7 +90,7 @@ fn test_obslog_with_or_without_diff() {
"###);
// Test `--no-graph`
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--no-graph"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog", "--no-graph"]);
insta::assert_snapshot!(stdout, @r###"
rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3
my description
@ -103,7 +103,7 @@ fn test_obslog_with_or_without_diff() {
"###);
// Test `--git` format, and that it implies `-p`
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--no-graph", "--git"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog", "--no-graph", "--git"]);
insta::assert_snapshot!(stdout, @r###"
rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3
my description
@ -144,7 +144,7 @@ fn test_obslog_with_or_without_diff() {
}
#[test]
fn test_obslog_with_custom_symbols() {
fn test_evolog_with_custom_symbols() {
let test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
let repo_path = test_env.env_root().join("repo");
@ -158,7 +158,7 @@ fn test_obslog_with_custom_symbols() {
let toml = concat!("templates.log_node = 'if(current_working_copy, \"$\", \"\")'\n",);
let stdout = test_env.jj_cmd_success(&repo_path, &["obslog", "--config-toml", toml]);
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog", "--config-toml", toml]);
insta::assert_snapshot!(stdout, @r###"
$ rlvkpnrz test.user@example.com 2001-02-03 08:05:10 66b42ad3
@ -173,7 +173,7 @@ fn test_obslog_with_custom_symbols() {
}
#[test]
fn test_obslog_word_wrap() {
fn test_evolog_word_wrap() {
let test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
let repo_path = test_env.env_root().join("repo");
@ -194,13 +194,13 @@ fn test_obslog_word_wrap() {
test_env.jj_cmd_ok(&repo_path, &["describe", "-m", "first"]);
// ui.log-word-wrap option applies to both graph/no-graph outputs
insta::assert_snapshot!(render(&["obslog"], 40, false), @r###"
insta::assert_snapshot!(render(&["evolog"], 40, false), @r###"
@ qpvuntsm test.user@example.com 2001-02-03 08:05:08 fa15625b
(empty) first
qpvuntsm hidden test.user@example.com 2001-02-03 08:05:07 230dd059
(empty) (no description set)
"###);
insta::assert_snapshot!(render(&["obslog"], 40, true), @r###"
insta::assert_snapshot!(render(&["evolog"], 40, true), @r###"
@ qpvuntsm test.user@example.com
2001-02-03 08:05:08 fa15625b
(empty) first
@ -208,13 +208,13 @@ fn test_obslog_word_wrap() {
2001-02-03 08:05:07 230dd059
(empty) (no description set)
"###);
insta::assert_snapshot!(render(&["obslog", "--no-graph"], 40, false), @r###"
insta::assert_snapshot!(render(&["evolog", "--no-graph"], 40, false), @r###"
qpvuntsm test.user@example.com 2001-02-03 08:05:08 fa15625b
(empty) first
qpvuntsm hidden test.user@example.com 2001-02-03 08:05:07 230dd059
(empty) (no description set)
"###);
insta::assert_snapshot!(render(&["obslog", "--no-graph"], 40, true), @r###"
insta::assert_snapshot!(render(&["evolog", "--no-graph"], 40, true), @r###"
qpvuntsm test.user@example.com
2001-02-03 08:05:08 fa15625b
(empty) first
@ -225,7 +225,7 @@ fn test_obslog_word_wrap() {
}
#[test]
fn test_obslog_squash() {
fn test_evolog_squash() {
let test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
let repo_path = test_env.env_root().join("repo");
@ -264,7 +264,7 @@ fn test_obslog_squash() {
);
let stdout =
test_env.jj_cmd_success(&repo_path, &["obslog", "-p", "-r", "description('squash')"]);
test_env.jj_cmd_success(&repo_path, &["evolog", "-p", "-r", "description('squash')"]);
insta::assert_snapshot!(stdout, @r###"
qpvuntsm test.user@example.com 2001-02-03 08:05:15 d49749bf
squashed 3
@ -321,12 +321,12 @@ fn test_obslog_squash() {
}
#[test]
fn test_obslog_with_no_template() {
fn test_evolog_with_no_template() {
let test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.env_root(), &["git", "init", "repo"]);
let repo_path = test_env.env_root().join("repo");
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["obslog", "-T"]);
let stderr = test_env.jj_cmd_cli_error(&repo_path, &["evolog", "-T"]);
insta::assert_snapshot!(stderr, @r###"
error: a value is required for '--template <TEMPLATE>' but none was supplied

View file

@ -966,7 +966,7 @@ fn test_squash_from_multiple_partial_no_op() {
let stdout = test_env.jj_cmd_success(
&repo_path,
&[
"obslog",
"evolog",
"-T",
r#"separate(" ", commit_id.short(), description)"#,
],

View file

@ -702,7 +702,7 @@ fn test_workspaces_current_op_discarded_by_other() {
secondary
"###);
let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["obslog"]);
let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["evolog"]);
insta::assert_snapshot!(stderr, @"");
insta::assert_snapshot!(stdout, @r###"
@ kmkuslsw test.user@example.com 2001-02-03 08:05:18 secondary@ b0b40043

View file

@ -50,15 +50,15 @@ parent-child relationships between commits you can see in `jj log`, this is
simply not what they mean. What you can see in `jj log` is that after the
working copy commit gets amended (after any edit), the commit ID changes.
You can see the actual history of working copy changes using `jj obslog`. This
You can see the actual history of working copy changes using `jj evolog`. This
will show the history of the commits that were previously the "working-copy
commit", since the last time the change id of the working copy commit changed.
The obsolete changes will be marked as "hidden". They are still accessible with
any `jj` command (`jj diff`, for example), but you will need to use the commit
id to refer to hidden commits.
You can also use `jj obslog -r` on revisions that were previously the
working-copy revisions (or on any other revisions). Use `jj obslog -p` as an
You can also use `jj evolog -r` on revisions that were previously the
working-copy revisions (or on any other revisions). Use `jj evolog -p` as an
easy way to see the evolution of the commit's contents.
### Can I prevent Jujutsu from recording my unfinished work? I'm not ready to commit it.
@ -200,7 +200,7 @@ $ jj config set --user git.private-commits 'description(glob:"private:*")'
### I accidentally changed files in the wrong commit, how do I move the recent changes into another commit?
Use `jj obslog -p` to see how your working-copy commit has evolved. Find the
Use `jj evolog -p` to see how your working-copy commit has evolved. Find the
commit you want to restore the contents to. Let's say the current commit (with
the changes intended for a new commit) are in commit X and the state you wanted
is in commit Y. Note the commit id (normally in blue at the end of the line in

View file

@ -322,7 +322,7 @@ op_log_node = 'if(current_operation, "@", "○")'
### Wrap log content
If enabled, `log`/`obslog`/`op log` content will be wrapped based on
If enabled, `log`/`evolog`/`op log` content will be wrapped based on
the terminal width.
```toml

View file

@ -14,7 +14,7 @@ object can be referenced as `self`.
### Commit keywords
In `jj log`/`jj obslog` templates, all 0-argument methods of [the `Commit`
In `jj log`/`jj evolog` templates, all 0-argument methods of [the `Commit`
type](#commit-type) are available as keywords. For example, `commit_id` is
equivalent to `self.commit_id()`.

View file

@ -123,9 +123,9 @@ typically depends on how done you are with the change; if the change is almost
done, it makes sense to use `jj new` so you can easily review your adjustments
with `jj diff` before running `jj squash`.
To view how a change has evolved over time, we can use `jj obslog` to see each
recorded change for the current commit. This records changes to the working
copy, message, squashes, rebases, etc.
To view how a change has evolved over time, we can use `jj evolog` to see each
recorded change for the current commit. This records changes to the working copy,
message, squashes, rebases, etc.
## The log command and "revsets"