Commit graph

1546 commits

Author SHA1 Message Date
Yuya Nishihara
16f2b82feb conflicts: change diff line marker to %%%%%%%
I feel the original -------/+++++++ pair is slightly confusing because
each half can be a separator by itself. I don't know what character other
than '-'/'+' is preferred, but let's pick '%' (for "mod") per @martinvonz
suggestion.
2022-09-20 15:26:29 +09:00
Martin von Zweigbergk
6e8f822901 docs: describe our unusual conflict marker style 2022-09-19 18:04:54 -07:00
Martin von Zweigbergk
5270c165ed cli: lift a return statement out of an if-else block
As pointed out by IntelliJ (maybe it came from rust-analyzer or
something, I don't know). I also lifted out
`Err(CommandError::UserError())` and extracted a variable.
2022-09-19 15:10:54 -07:00
dependabot[bot]
8402dd8264 cargo: bump insta from 1.19.1 to 1.20.0
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.19.1 to 1.20.0.
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.19.1...1.20.0)

---
updated-dependencies:
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 10:05:05 -07:00
Martin von Zweigbergk
ff055a0701 cli: accept -r and ignore where revision is positional
Commands that take both paths and revisions as arguments take paths as
positional arguments and use `-r` for revisions (or more specific
options like `--from` and `--to`). It's therefore natural for the user
to think that they can run e.g. `jj describe -r abc123`. However,
since `jj describe` doesn't accept paths, it doesn't have a `-r`
argument either. Let's allow the user to specify a superfluous `-r`
that we just ignore.

This handling means that the user could run `jj show -r` (without a
revision argument) and it would use the default revision. That's
confusing, but at least we won't accept e.g. `jj show -r README.md`
(unless `README.md` is a revision), so it's probably okay?
2022-09-19 09:44:33 -07:00
Martin von Zweigbergk
6812bd9584 cleanup: rename checkout to wc_commit
`wc_commit` seems clearer than `checkout` and not too much longer. I
considered `working_copy` but it was less clear (could be the path to
the working copy, or an instance of `WorkingCopy`). I also considered
`working_copy_commit`, but that seems a bit too long.
2022-09-18 16:19:58 -07:00
Martin von Zweigbergk
c36b720dd4 cli: rename checkout to working_copy in template 2022-09-18 16:19:58 -07:00
Martin von Zweigbergk
6e23b5b052 docs: change "current checkout" to "working-copy commit"
I think "the working-copy commit" is clearer.
2022-09-18 16:19:58 -07:00
Martin von Zweigbergk
86f216541a github: remove publish_results field in wrong place
When I read
https://github.com/ossf/scorecard-action#breaking-changes-in-v2 for
6d7ce74a9a, it seems like I misread the "for" as "and" in "`include
id-token: write` for `publish_results: true`". The latter is not a
permissions, it's another setting we have defined further down.
2022-09-18 00:14:39 -07:00
Martin von Zweigbergk
46578fb892 cli: don't show open commits in green when open commits are disabled
I had missed that `Ui::write_commit_summary()` still shows open
commits in green even when open commits are disabled (as they are by
default these days). This patch fixes that.

The user can still override templates to format open commits
differently, but I'm not sure it's worth fixing that.
2022-09-17 22:52:20 -07:00
Yuya Nishihara
f3d39c7820 cli: add value_hint to support basic path completion
Otherwise 'jj diff [TAB]' doesn't provide completion on my zsh.
2022-09-18 00:02:30 +09:00
Martin von Zweigbergk
3c22ce11a4 github: remove stale comments indicating action versions
Dependabot doesn't update the comments, so they go stale very quickly.
2022-09-16 21:58:47 -07:00
dependabot[bot]
557d93b0e8 cargo: bump clap from 3.2.21 to 3.2.22
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.21 to 3.2.22.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.22/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.21...v3.2.22)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-16 16:26:24 -05:00
dependabot[bot]
17765d08cd github: bump github/codeql-action from 2.1.23 to 2.1.24
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.23 to 2.1.24.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](6a38b7d4a1...904260d7d9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-16 16:25:37 -05:00
Martin von Zweigbergk
6d7ce74a9a github: add new required permissions for ossf/scorecard 2022-09-16 08:53:11 -05:00
Yuya Nishihara
c9c3735faf cli: add basic support for 'jj log PATH'
In the current implementation, tree is diffed twice if both PATH and -p
are specified. If this adds significant cost, we'll need to reimplement
it without using a revset abstraction (or maybe adjust revset/graph API.)
2022-09-16 13:02:58 +09:00
Yuya Nishihara
873b5ba771 cli: pass in matcher to show_patch() 2022-09-16 13:02:58 +09:00
Yuya Nishihara
98a66002b0 revset: add function to filter commits by matcher
This will be a basic building block of 'jj log PATH'. The implementation
is naive, but works fine for small repos like jj. For mid-size repos,
there would be various areas which need to be optimized.
2022-09-16 13:02:58 +09:00
dependabot[bot]
1145d7bfaa cargo: bump thiserror from 1.0.34 to 1.0.35
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.34 to 1.0.35.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.34...1.0.35)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-15 21:52:44 -05:00
dependabot[bot]
53ccb8d59b github: bump github/codeql-action from 2.1.22 to 2.1.23
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.22 to 2.1.23.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b398f525a5...6a38b7d4a1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-15 21:52:07 -05:00
Kyle Lippincott
f173f59932 Fix typo in error message 2022-09-14 15:29:53 -07:00
dependabot[bot]
6f59a12f60 cargo: bump clap_complete from 3.2.4 to 3.2.5
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.2.4...clap_complete-v3.2.5)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 23:36:27 -05:00
dependabot[bot]
502942183e cargo: bump pest_derive from 2.3.0 to 2.3.1
Bumps [pest_derive](https://github.com/pest-parser/pest) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/pest-parser/pest/releases)
- [Commits](https://github.com/pest-parser/pest/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: pest_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 23:22:31 -05:00
dependabot[bot]
f2386970d6 cargo: bump whoami from 1.2.1 to 1.2.3
Bumps [whoami](https://github.com/ardaku/whoami) from 1.2.1 to 1.2.3.
- [Release notes](https://github.com/ardaku/whoami/releases)
- [Changelog](https://github.com/ardaku/whoami/blob/stable/CHANGELOG.md)
- [Commits](https://github.com/ardaku/whoami/compare/v1.2.1...v1.2.3)

---
updated-dependencies:
- dependency-name: whoami
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 23:11:08 -05:00
dependabot[bot]
26551b79b7 cargo: bump clap from 3.2.20 to 3.2.21
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.20 to 3.2.21.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.21/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.20...v3.2.21)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 23:09:57 -05:00
dependabot[bot]
7a09ed4473 cargo: bump itertools from 0.10.3 to 0.10.4
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.3 to 0.10.4.
- [Release notes](https://github.com/rust-itertools/itertools/releases)
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.3...v0.10.4)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 23:09:32 -05:00
Ilya Grigoriev
802125aa3c Reword paragraph about jj and other VCS in README
Fixes two pedantic issues with this paragraph:

* "either" describing more than two things

* I am not an expert, but I suspect that Pijul
  supports "automatic rebase".
2022-09-12 20:12:07 -07:00
Ilya Grigoriev
3244398e89 Fix rebase -r of a parent of a merge commit
Previously, using `rebase -r` on the parent of a merge commit
turned it into a non-merge commit. In other words, starting
with

```
    o   d
    |\
    o | c
    o | b
    | o a
    |/  
    o 
```

and doing `rebase -r c -d a` resulted in

```
    o d
    o b
    | o c
    | o a
    |/  
    o 
```

where `d` is no longer a merge commit.

For reference, here's a complete test that passed before this commit (but should NOT pass; see the diff for a test that should pass):

```
#[test]
fn test_rebase_single_revision_merge_parent() {
    let test_env = TestEnvironment::default();
    test_env.jj_cmd_success(test_env.env_root(), &["init", "repo", "--git"]);
    let repo_path = test_env.env_root().join("repo");

    create_commit(&test_env, &repo_path, "a", &[]);
    create_commit(&test_env, &repo_path, "b", &[]);
    create_commit(&test_env, &repo_path, "c", &["b"]);
    create_commit(&test_env, &repo_path, "d", &["a", "c"]);
    // Test the setup
    insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
    @
    o   d
    |\
    o | c
    o | b
    | o a
    |/
    o
    "###);

    let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "c", "-d", "a"]);
    insta::assert_snapshot!(stdout, @r###"
    Also rebased 2 descendant commits onto parent of rebased commit
    Working copy now at: 3e176b54d680 (no description set)
    Added 0 files, modified 0 files, removed 2 files
    "###);
    insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
    @
    o d
    | o c
    o | b
    | o a
    |/
    o
    "###);
}
```
2022-09-12 12:23:21 -07:00
Martin von Zweigbergk
10d24ef267 github: remove broken workflow to enable auto-merge for Dependabot
The workflow that was supposed to enable auto-merge for PRs from
Dependabot is failing like this:


```
Message: Resource not accessible by integration, Locations: [{Line:1 Column:72}]
```

I can't figure out why it's failing (maybe
https://github.com/cli/cli/issues/1314?), so let's just remove it.
2022-09-12 10:23:58 -07:00
dependabot[bot]
839eb1d900 cargo: bump criterion from 0.3.6 to 0.4.0
Bumps [criterion](https://github.com/bheisler/criterion.rs) from 0.3.6 to 0.4.0.
- [Release notes](https://github.com/bheisler/criterion.rs/releases)
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bheisler/criterion.rs/compare/0.3.6...0.4.0)

---
updated-dependencies:
- dependency-name: criterion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:19:31 -07:00
dependabot[bot]
210528e8ae github: bump ossf/scorecard-action from 1.1.2 to 2.0.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.1.2 to 2.0.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](ce330fde6b...865b409285)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:00:26 -07:00
dependabot[bot]
8e37bbc86e cargo: bump pest from 2.3.0 to 2.3.1
Bumps [pest](https://github.com/pest-parser/pest) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/pest-parser/pest/releases)
- [Commits](https://github.com/pest-parser/pest/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: pest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 08:58:18 -07:00
dependabot[bot]
b526d6f466 cargo: bump criterion_bencher_compat from 0.3.4 to 0.4.0
Bumps [criterion_bencher_compat](https://github.com/bheisler/criterion.rs) from 0.3.4 to 0.4.0.
- [Release notes](https://github.com/bheisler/criterion.rs/releases)
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bheisler/criterion.rs/compare/0.3.4...0.4.0)

---
updated-dependencies:
- dependency-name: criterion_bencher_compat
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 08:58:04 -07:00
Yuya Nishihara
b21a123bc8 cli: ensure rebase destinations are unique and not form a merge with root 2022-09-12 23:46:15 +09:00
Yuya Nishihara
cf0ab8b12b cli: extract helper function that resolves revisions to be used as base
We'll apply this logic to 'rebase -d'.
2022-09-12 23:46:15 +09:00
Martin von Zweigbergk
135fc93898 cli: document repeated -d arguments for jj rebase 2022-09-11 18:25:44 -07:00
Martin von Zweigbergk
5b17d82cf8 cli: add a version command
Closes #529.
2022-09-11 18:25:09 -07:00
Yuya Nishihara
459f2f78ba cli: on finish_transaction(), record operation id even if working copy is clean
While debugging stale working-copy recovery, I noticed the checkout commit
resurrected from the ancestor_op was way beyond the ancestor commit made by
jj squash. This patch is a workaround for the problem.

I'm not pretty sure if updating operation id is the right thing. If not, maybe
we'll need to look up more recent operation corresponding to the wc tree id from
the <ancestor_op>: range?
2022-09-11 16:18:10 +09:00
Martin von Zweigbergk
c7a782b0a1 github: give dependabot auto-merge action permission to update PR
Hopefully this is the last bit I was missing to get this to work :)
2022-09-09 12:43:56 -07:00
Josh Soref
49215323b2 spelling: use cases
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-09 11:58:37 -07:00
Josh Soref
0e26e4bac4 spelling: the
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-09 11:58:37 -07:00
Josh Soref
99746a018b spelling: shouldn't
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-09 11:58:37 -07:00
Josh Soref
fd3f8afe1a spelling: nonexistent
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-09 11:58:37 -07:00
Josh Soref
a591325e07 spelling: into
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-09 11:58:37 -07:00
Josh Soref
e0bd06818e spelling: commit
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-09 11:58:37 -07:00
Josh Soref
257baf8dfb spelling: changes
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-09 11:58:37 -07:00
Yuya Nishihara
3b60769874 diff_edit: do not make directories readonly
Otherwise directories containing files cannot be removed.

I think making files readonly is enough to tell user that the left side
cannot be edited, but I haven't tested that with Meld. If that's not enough,
we'll probably need to undo set_readonly_recursively() at exit.
2022-09-07 23:50:06 +09:00
Yuya Nishihara
e4a39137c9 diff_edit: create temporary directory with stable prefix 2022-09-07 23:50:06 +09:00
Yuya Nishihara
31e90bdede tests: use tempfile::TempDir instead of env::temp_dir() + random number
Otherwise /tmp/test-<random> file would be left.
2022-09-07 23:49:46 +09:00
Yuya Nishihara
3b835df66e tests: do not use TempDir::into_path() which would persist the directory
https://docs.rs/tempfile/3.3.0/tempfile/struct.TempDir.html#method.into_path
2022-09-07 23:49:46 +09:00