Commit graph

1529 commits

Author SHA1 Message Date
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
Yuya Nishihara
872081c867 tests: use testutils::new_temp_dir() thoroughly 2022-09-07 23:49:46 +09:00
Yuya Nishihara
b0e9f1a852 tests: add utility function to create temporary dir with stable prefix
I noticed lots of /tmp/.tmp* directories were left after running tests.
This makes these directories more discoverable.
2022-09-07 23:49:46 +09:00
Martin von Zweigbergk
a33417fa35 github: pass --rebase to gh pr merge since it requires it
It seems that there's no way to just enable auto-merge without
specifying a merge strategy (presumably because some projects allow
several GitHub merge strategies), so I guess we'll have to live with
the strategy being duplicated between here and the project settings.
2022-09-06 16:08:24 -07:00
Martin von Zweigbergk
47e7307dcc cargo: run cargo update
Our current version of `cpufeatures` was yanked so we needed to
upgrade at least that. Note that I had to add "UNICODE-DFS-2016" as an
allowed license for `cargo-deny`. I also had to upgrade `chrono` from
0.4.20 to 0.4.22 in the `Cargo.toml` files to prevent `cargo update`
from *downgrading* it in the lock file.
2022-09-06 15:50:05 -07:00
Martin von Zweigbergk
4ea304a47d cli: add jj hide as an alias for jj abandon
I keep explaining the functionality as hiding the commit, so it seems
that `jj hide` is a natural name for it. Let's start by adding it as
an alias. My only hesitation with making `hide` the real command name
and `abandon` an alias that we start phasing out is that it feels more
natural to `abandon` the working copy in order to start working on a
new change than it does to `hide` it.
2022-09-04 20:43:01 -07:00
Martin von Zweigbergk
2ff710a131 github: enable auto-merge on Dependabot PRs
To merge a Dependabot PR, I have to enable auto-merge (two clicks,
including one to confim) and then review and approve it. Since our
branch protections require the PR to be approved, it seems that that
should be enough. This patch adds a GitHub action that calls runs the
GitHub CLI to do that. It is based on
https://dev.to/slashgear_/how-to-automatically-merge-dependabot-pull-requests-with-github-actions--30pe
2022-09-02 11:49:26 -07:00
dependabot[bot]
ff2e6c9c5b cargo: bump clap from 3.2.19 to 3.2.20
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.19 to 3.2.20.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.20/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.19...v3.2.20)

---
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-02 08:43:20 -07:00
Glen Choo
468418f1ce cli: add interdiff command
Add the `jj interdiff` command for comparing only the diffs of commits.
Its args are identical to that of `jj diff`, minus `--revision` (because
interdiff always requires two commits).

Like `jj obslog -p`, Changes introduced by intervening commits are
ignored by rebasing `--from` onto `--to` 's parents.
2022-09-02 02:59:37 +08:00
Glen Choo
ed415c17b0 cli: refactor out rebase_to_destination_parent()
Refactor out the parent-rebasing parts of show_predecessor_patch() to
create rebase_to_destination_parent(). This will be reused for `jj
interdiff`.
2022-09-02 02:59:37 +08:00
dependabot[bot]
d53d9020c9 cargo: bump insta from 1.19.0 to 1.19.1
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.19.0 to 1.19.1.
- [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.0...1.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 10:50:49 -07:00
dependabot[bot]
989fcb6276 cargo: bump thiserror from 1.0.32 to 1.0.33
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.32...1.0.33)

---
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-01 10:50:30 -07:00
dependabot[bot]
cdbb24fdd4 cargo: bump clap from 3.2.18 to 3.2.19
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.18 to 3.2.19.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.19/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.18...v3.2.19)

---
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-01 10:50:01 -07:00
dependabot[bot]
471a5c81d7 cargo: bump clap_mangen from 0.1.10 to 0.1.11
Bumps [clap_mangen](https://github.com/clap-rs/clap) from 0.1.10 to 0.1.11.
- [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_mangen-v0.1.10...clap_mangen-v0.1.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 10:49:28 -07:00
dependabot[bot]
f0d7381fa6 github: bump github/codeql-action from 2.1.19 to 2.1.22
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.19 to 2.1.22.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f5d217be74...b398f525a5)

---
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-01 10:49:04 -07:00
Yuya Nishihara
c5aab9fe29 cli: fix crash on "jj merge whatever root" 2022-09-01 13:36:17 +09:00
Yuya Nishihara
1cc7fc4cd9 cli: error out if "new" parent revisions aren't unique
If more than one parents are specified, the user would expect a merge
commit.
2022-09-01 13:36:17 +09:00
Martin von Zweigbergk
3a46623446 cli: make jj merge delegate to jj new 2022-08-31 07:51:32 -07:00