Commit graph

1403 commits

Author SHA1 Message Date
Martin von Zweigbergk
fc578a2dd7 conflicts: use insta in conflict tests 2022-07-12 07:46:45 -07:00
dependabot[bot]
9dab88260a cargo: bump serde from 1.0.138 to 1.0.139
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.138 to 1.0.139.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.138...v1.0.139)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 09:18:08 -07:00
Martin von Zweigbergk
97cecb245d cleanup: remove workaround for fixed split_inclusive() bug
The fix for rustlang/rust#89716 was released in 1.59.0, which is our
MSRV.
2022-07-10 11:09:01 -07:00
Randall Mason
fb32a417ee Add Sturdy to related work
Sturdy came up a while ago on lobste.rs when [jj was being discussed](https://lobste.rs/s/47zztj/jujutsu_dvcs).  I'm not sure if I described it well, or if it's something you want as related-work, especially since the sturdy founder claims to be solving different problems in the very thread.  But it does seem to be doing some similar things to removing the idea of an index/staging area.
2022-07-09 16:48:18 -07:00
dependabot[bot]
a10a629c18 cargo: bump criterion from 0.3.5 to 0.3.6
Bumps [criterion](https://github.com/bheisler/criterion.rs) from 0.3.5 to 0.3.6.
- [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.5...0.3.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 20:45:07 -07:00
Yuya Nishihara
c2ce1eedca diff: make sure word diff print final newline
Since whitespace change is barely visible in color-words diff, I think it
would be too verbose to add "\ No newline at end of file" marker. Let's just
append missing newline to make the command output readable.
2022-07-07 23:29:18 +09:00
dependabot[bot]
22b1511f2a cargo: bump openssl-src from 111.20.0+1.1.1o to 111.22.0+1.1.1q
Bumps [openssl-src](https://github.com/alexcrichton/openssl-src-rs) from 111.20.0+1.1.1o to 111.22.0+1.1.1q.
- [Release notes](https://github.com/alexcrichton/openssl-src-rs/releases)
- [Commits](https://github.com/alexcrichton/openssl-src-rs/commits)

---
updated-dependencies:
- dependency-name: openssl-src
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 13:27:10 -07:00
dependabot[bot]
40afd98720 cargo: bump regex from 1.5.6 to 1.6.0
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.6 to 1.6.0.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.6...1.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 08:47:33 -07:00
Martin von Zweigbergk
3a351bee7d cli: don't keep Repo references from before transaction start
We had a recent bug where we used a repo reference from before we
started a transaction and modified the repo. While it's often safe and
correct to use such references, it isn't always. This patch removes
all such cases. I think it generally makes the code clearer, and
better prepared for #50, if we ever get around to that. I found these
by temporarily making `WorkspaceCommandHelper::start_transaction()`
take a mutable reference.
2022-07-06 07:21:57 -07:00
Martin von Zweigbergk
1b5cd140d5 CommitBuilder: remove unneeded store arguments
The `CommitBuilder::store` field is used only in
`CommitBuilder::write_to_repo()`, but we can easily get access to the
`Store` from the `repo` argument there, so let's remove the field.
2022-07-06 07:21:57 -07:00
Martin von Zweigbergk
c2c32ba0dc cli: don't use stale index to look up snapshotted working copy 2022-07-05 00:42:40 -07:00
Martin von Zweigbergk
be15d167c6 cli: don't start transaction before snapshotting working copy
In the `jj git push --change X` code, we start a transaction and then
resolve the argument, which often results in the working copy getting
snapshotted. Since the snapshotting happens in its own transaction,
that means we have two concurrent operations for no good reason. This
patch fixes that by starting the main transaction a little
later. Since that restructuring made it easy to give more detailed
descriptions to the operations, I also did that.
2022-07-05 00:42:40 -07:00
Martin von Zweigbergk
75dc65c30f cli: fix bad copy&paste in operation description for push
The operation log entry for `jj git push` currently says "import git
refs". That seems like just a bad copy&paste. While it used to be
technically correct that the only effect on the repo was from the
import, now that we have the `jj git push --change`, that is no longer
even true.
2022-07-05 00:42:40 -07:00
Martin von Zweigbergk
7a99257040 cli: add a --dry-run for jj git push 2022-07-04 22:50:40 -07:00
Martin von Zweigbergk
c10c510e01 cli: make jj git push print what it's going to push
It's convenient to push all changed branches every time with `jj git
push`, but sometimes I want to know which branches were actually
pushed. This make the command print what it's going to do.

I'll add a `--dry-run` mode and tests next.
2022-07-04 22:50:40 -07:00
Martin von Zweigbergk
3aaeca9e1c tests: add test for successful push
I think I had not added tests for successful push before because I
thought there was some issue with testing it with libgit2. There *is*
an issue, which is that libgit2 requires the remote to be bare when
it's on local disk, but we can very easily make the git repo bare in
this test.

I also updated the error handling in the `git` module to not let
follow-on errors hide the real error and to not fail if two branches
moved to the same commit.
2022-07-04 22:50:40 -07:00
dependabot[bot]
d767bab2c5 cargo: bump serde from 1.0.137 to 1.0.138
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.137 to 1.0.138.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.137...v1.0.138)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 17:24:10 -07:00
Martin von Zweigbergk
d3f2b4c9cd cli: fix mention of jj git pull to be jj git fetch
This addresses the issue from the title of #412.
2022-07-02 11:06:45 +08:00
Martin von Zweigbergk
88864871b7 cli: if clone fails, delete destination directory
Closes #400.
2022-07-01 11:48:56 +08:00
Martin von Zweigbergk
485dcb2779 cli: on clone, split fetch transaction from checkout transaction
Fetching is typically much expensive than checking out, so if fetching
completes but checking out fails (due to some bug, perhaps), it seems
better to commit the fetch transaction. That way, the user can inspect
the repo and try checking out again.
2022-07-01 11:48:56 +08:00
Martin von Zweigbergk
a2b4bd239f cli: check that clone target is an empty dir if it exists
We used to check only if the destination already had a `.jj/`
directory. This patch changes that to check that the destination is an
empty directory.

Closes #399.
2022-07-01 09:03:24 +08:00
Martin von Zweigbergk
5d871810a1 tests: add test for jj git clone
We didn't seem to have any. I included a test for #399.

The tests also showed how the debug formatting (`{:?}`) results in
escaped (e.g.) backslashes on Windows, which is not what we want, so I
also fixed that.
2022-07-01 09:03:24 +08:00
Martin von Zweigbergk
418ab22be0 cli: add config for using only new UX for open commits
By adding `ui.open-commits=false` in your config, you can now make `jj
checkout` always create a new working-copy commit on top of the
specified commit. If the config is set, open commits will also appear
in the same color as closed commits in `jj log` etc. This will let
some of us experiment with the new UX before we decide if it's a good
idea or not. I left `jj close` in place because it's useful for
setting a description and creating a new commit in one step.

I didn't mention the new config in the release notes because I hope we
can reach a decision and remove the config before the next release.
2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
42b2937d5e cli: add jj edit for editing a commit in the wokring copy 2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
6952b4f91e rewrite: create new checkout on top iff commit abandoned
When rebasing commits after rewrites, we also update all workspaces'
checkouts. If the new commit is closed, we create a new commit on
top. Since we're hoping to remove the open/closed concept, we need a
new condition. I considered creating a new commit on top if the change
ID was different from before the rewrite. However, that would make at
least `jj split` more complicated because it makes the first commit
keep the change ID but it wants the second commit to be checked
out. This patch instead creates the new commit on top only when the
original commit was abandoned.
2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
3e3299fbab cli: make jj close manually check out the new commit
When a commit gets rewritten, we update any workspaces pointing to the
old commit to check out the rewritten commit. If the rewritten commit
is closed, we create a new working-copy commit on top of it. Since
we're thinking about removing the open/closed concept, we need to make
`jj close` manually create the new working-copy commit.
2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
b0912b3199 repo: add a function for getting workspaces by checkout 2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
0e812220af rewrite: always use MutableRepo::edit() when updating checkouts
I think it's conceptually simpler to create a new commit and set that
commit to be the checkout in each workspace than to check out the
commit in one workspace and edit in the others.
2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
bd1a8bd930 repo: split out an edit() function from MutableRepo::check_out() 2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
9a3c6928cc repo: extract a function for abandoning previous checkout
This is a little refactoring to prepare for removing the `open` flag
off of commits.
2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
54285a9c56 tests: add test of jj checkout
I'm about to change how `jj checkout` works w.r.t. open/closed commits
(and in particular by moving some logic from the library crate to the
CLI), so let's make sure we have some test coverage.
2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
9c55d98842 cli: rename jj edit to jj touchup 2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
fc4b109e5b cli: allow pushing open commits
Since we're thinking of removing the concept of open and closed
commits, we can't use that open/closed distinction to decide to not
push some commits.
2022-07-01 08:58:08 +08:00
Martin von Zweigbergk
8667e374b8 rewrite: pass a single new commit into update_checkouts()
`DescendantRebaser::update_checkouts()` only cares about the first
element in `new_commit_ids`, so let's just pass in a single commit ID
instead.
2022-07-01 08:58:08 +08:00
dependabot[bot]
73729e4517 cargo: bump serde_json from 1.0.81 to 1.0.82
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.81...v1.0.82)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 02:19:56 +08:00
dependabot[bot]
79c0b2696c cargo: bump clap from 3.2.7 to 3.2.8
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.7 to 3.2.8.
- [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/v3.2.7...v3.2.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 02:19:28 +08:00
Martin von Zweigbergk
c2a7152423 docs: explain that we don't support Git hooks 2022-07-01 00:38:56 +08:00
dependabot[bot]
40293b5f9a github: bump github/codeql-action from 2.1.14 to 2.1.15
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.14 to 2.1.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](41a4ada31b...3f62b754e2)

---
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-06-30 12:53:45 +08:00
Richard Smith
2d01ebb57c Fix help formatting and missing word. 2022-06-29 14:52:12 -07:00
Martin von Zweigbergk
0fe203ce8f cleanup: fix an unused import on Windows
`OperationId` is only used in `test_snapshot_special_file()`, which
doesn't run (or even  build) on Windows.
2022-06-29 07:21:24 +08:00
dependabot[bot]
d5ae66a5e0 cargo: bump clap_complete from 3.2.2 to 3.2.3
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.2.2 to 3.2.3.
- [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.2...clap_complete-v3.2.3)

---
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-06-29 06:51:07 +08:00
dependabot[bot]
937ab16471 cargo: bump clap_mangen from 0.1.9 to 0.1.10
Bumps [clap_mangen](https://github.com/clap-rs/clap) from 0.1.9 to 0.1.10.
- [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.9...clap_mangen-v0.1.10)

---
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-06-29 06:30:28 +08:00
dependabot[bot]
dbfaef5eac cargo: bump clap from 3.2.6 to 3.2.7
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.6 to 3.2.7.
- [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/v3.2.6...v3.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-29 06:29:22 +08:00
dependabot[bot]
54de880845 github: bump ossf/scorecard-action from 1.1.1 to 1.1.2
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](3e15ea8318...ce330fde6b)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-29 06:28:31 +08:00
Tal Pressman
0028c0e295 Update installation instructions
Update installation instructions to only install `jj` (excluding test fakes).
2022-06-28 06:38:16 +08:00
dependabot[bot]
784692007f github: bump github/codeql-action from 2.1.13 to 2.1.14
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.13 to 2.1.14.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](d00e8c09a3...41a4ada31b)

---
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-06-27 06:25:48 +08:00
dependabot[bot]
865b4ff0a4 cargo: bump clap from 3.2.5 to 3.2.6
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.5 to 3.2.6.
- [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/v3.2.5...v3.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 05:40:16 +08:00
dependabot[bot]
8036177f94 cargo: bump clap_complete from 3.1.4 to 3.2.2
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.1.4 to 3.2.2.
- [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.1.4...clap_complete-v3.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 07:31:22 +07:00
dependabot[bot]
0419f2c561 cargo: bump clap_mangen from 0.1.7 to 0.1.9
Bumps [clap_mangen](https://github.com/clap-rs/clap) from 0.1.7 to 0.1.9.
- [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.7...clap_mangen-v0.1.9)

---
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-06-22 07:30:26 +07:00
Martin von Zweigbergk
d10f61dd88 cargo: bump clap from v3.1.18 to v3.2.5 2022-06-22 06:39:25 +07:00