From a0fae766225006d7d7965c3261f7f39553fbb8f8 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 24 Jul 2024 06:49:18 -0700 Subject: [PATCH] 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"). --- CHANGELOG.md | 3 + cli/src/commands/{obslog.rs => evolog.rs} | 8 +- cli/src/commands/interdiff.rs | 2 +- cli/src/commands/mod.rs | 7 +- cli/src/commit_templater.rs | 2 +- cli/tests/cli-reference@.md.snap | 80 +++++++++---------- cli/tests/runner.rs | 2 +- cli/tests/test_commit_template.rs | 10 +-- ...slog_command.rs => test_evolog_command.rs} | 36 ++++----- cli/tests/test_squash_command.rs | 2 +- cli/tests/test_workspaces.rs | 2 +- docs/FAQ.md | 8 +- docs/config.md | 2 +- docs/templates.md | 2 +- docs/tutorial.md | 6 +- 15 files changed, 86 insertions(+), 86 deletions(-) rename cli/src/commands/{obslog.rs => evolog.rs} (98%) rename cli/tests/{test_obslog_command.rs => test_evolog_command.rs} (93%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce294db89..ea31813fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cli/src/commands/obslog.rs b/cli/src/commands/evolog.rs similarity index 98% rename from cli/src/commands/obslog.rs rename to cli/src/commands/evolog.rs index 11465165e..4697e6e77 100644 --- a/cli/src/commands/obslog.rs +++ b/cli/src/commands/evolog.rs @@ -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(); diff --git a/cli/src/commands/interdiff.rs b/cli/src/commands/interdiff.rs index ded5fd99e..6e309e005 100644 --- a/cli/src/commands/interdiff.rs +++ b/cli/src/commands/interdiff.rs @@ -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 { diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index 615003e07..1a046e33d 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -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), diff --git a/cli/src/commit_templater.rs b/cli/src/commit_templater.rs index a1b54a557..2ce8849e2 100644 --- a/cli/src/commit_templater.rs +++ b/cli/src/commit_templater.rs @@ -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 }); diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index aeb526fca..bf3f53b97 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -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 ` + + Default value: `@` +* `-n`, `--limit ` — Limit number of revisions to show +* `--no-graph` — Don't show the graph, show a flat list of revisions +* `-T`, `--template