Skip to content

Commit

Permalink
diff_util: Add the short alias S for --stat
Browse files Browse the repository at this point in the history
This was a suggestion from sm in the libera #jujutsu IRC chat.
  • Loading branch information
PhilipMetzger committed Jan 10, 2025
1 parent 80c4222 commit ad23ffc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ changes. Two select improvements:
below it, similar to a "scissor line" in git. When editing multiple commits,
only ignore until the next `JJ: describe` line.

* The `--stat` option for `jj log`, `jj show` and `jj diff` now has a
short alias `-S`

### Fixed bugs

* The `$NO_COLOR` environment variable must now be non-empty to be respected.
Expand Down
2 changes: 1 addition & 1 deletion cli/src/diff_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub struct DiffFormatArgs {
#[arg(long, short)]
pub summary: bool,
/// Show a histogram of the changes
#[arg(long)]
#[arg(long, short = 'S')]
pub stat: bool,
/// For each path, show only its type before and after
///
Expand Down
16 changes: 8 additions & 8 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ With the `--from` and/or `--to` options, shows the difference from/to the given
* `-f`, `--from <REVSET>` — Show changes from this revision
* `-t`, `--to <REVSET>` — Show changes to this revision
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `-S`, `--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.
Expand Down Expand Up @@ -806,7 +806,7 @@ Lists the previous commits which a change has pointed to. The current commit of
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
* `-S`, `--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.
Expand Down Expand Up @@ -1333,7 +1333,7 @@ This excludes changes from other commits by temporarily rebasing `--from` onto `
* `-f`, `--from <REVSET>` — Show changes from this revision
* `-t`, `--to <REVSET>` — Show changes to this revision
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `-S`, `--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.
Expand Down Expand Up @@ -1384,7 +1384,7 @@ The working-copy commit is indicated by a `@` symbol in the graph. Immutable rev
If not specified, this defaults to the `templates.log` setting.
* `-p`, `--patch` — Show patch
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `-S`, `--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.
Expand Down Expand Up @@ -1531,7 +1531,7 @@ Compare changes to the repository between two operations
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
* `-S`, `--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.
Expand Down Expand Up @@ -1567,7 +1567,7 @@ Like other commands, `jj op log` snapshots the current working-copy changes and
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
* `-S`, `--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.
Expand Down Expand Up @@ -1633,7 +1633,7 @@ Show changes to the repository in an operation
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
* `-S`, `--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.
Expand Down Expand Up @@ -1966,7 +1966,7 @@ Show commit description and changes in a revision
For the syntax, see https://jj-vcs.github.io/jj/latest/templates/
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `-S`, `--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.
Expand Down

0 comments on commit ad23ffc

Please sign in to comment.