Commit graph

1423 commits

Author SHA1 Message Date
dependabot[bot]
e857152fa0 cargo: bump insta from 1.16.0 to 1.17.0
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.16.0 to 1.17.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/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-29 14:35:12 +02:00
dependabot[bot]
753fd99846 cargo: bump clap from 3.2.14 to 3.2.15
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.14 to 3.2.15.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.15/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.14...v3.2.15)

---
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-29 14:34:41 +02:00
dependabot[bot]
db971fa29f cargo: bump test-case from 2.1.0 to 2.2.1
Bumps [test-case](https://github.com/frondeus/test-case) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v2.1.0...v2.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-24 10:52:00 +02:00
dependabot[bot]
202f9038c7 cargo: bump insta from 1.15.0 to 1.16.0
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.15.0 to 1.16.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.15.0...1.16.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-07-24 10:51:38 +02:00
dependabot[bot]
96abce5a8e cargo: bump serde from 1.0.139 to 1.0.140
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.139 to 1.0.140.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.139...v1.0.140)

---
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-24 10:51:13 +02:00
dependabot[bot]
c66b8307bd cargo: bump clap from 3.2.13 to 3.2.14
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.13 to 3.2.14.
- [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.13...v3.2.14)

---
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-24 10:50:55 +02:00
Martin von Zweigbergk
cb8f7b8184 store: inline Store::load() into caller
I think it makes sense for `RepoLoader` to know what kind of backend
to create. Then we can have some way of extending it for other backend
types.
2022-07-21 17:04:18 +02:00
Martin von Zweigbergk
25b922cd0b store: reduce duplication in Workspace and Repo init code
There is a bit of duplicated across the three functions for creating a
`Workspace` and `Repo`. This patch reduces that duplication by passing
in a closure.

In addition to reducing duplication, this is a step towards making it
easier to add new backends.
2022-07-21 17:04:18 +02:00
dependabot[bot]
07c8126053 cargo: bump clap from 3.2.12 to 3.2.13
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.12 to 3.2.13.
- [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.12...v3.2.13)

---
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-21 07:11:56 +02:00
dependabot[bot]
bf8a8caf01 cargo: bump bytes from 1.1.0 to 1.2.0
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.1.0...v1.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 07:11:35 +02:00
iain barnett
980004e908 Added barebones config template with the odd alternative commented out. 2022-07-16 21:28:40 -07:00
iain barnett
573320ba7d Documented available config settings.
docs: Added config settings to documentation.
2022-07-16 21:28:40 -07:00
dependabot[bot]
92fc2ceb5f cargo: bump clap from 3.2.11 to 3.2.12
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.11 to 3.2.12.
- [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.11...v3.2.12)

---
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-14 10:59:16 -07:00
Martin von Zweigbergk
36c6236f62 workspace: remove upgrade code for workspace without .jj/repo 2022-07-14 10:58:11 -07:00
Martin von Zweigbergk
51b65128f3 cli: snapshot the working copy before pushing
The working copy does not get snapshotted by `jj git push`, `jj git
push --all`, and `jj git push --branch`. This fixes that.

We should probably do the snapshotting in a more central place, so we
can't forget it like this, but I'll leave that for later.
2022-07-13 23:21:45 -07:00
Martin von Zweigbergk
8bc4574ee5 cli: push only branches pointing to @ by default
Since we now allow pushing open commits, we can implement support for
pushing the "current" branch by defining a "current" branch as any
branch pointing to `@`. That definition of a current/active seems to
have been the consensus in discussion #411.

Closes #246.
2022-07-13 16:23:13 -07:00
dependabot[bot]
78e7a7d176 cargo: bump clap from 3.2.10 to 3.2.11
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.10 to 3.2.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/v3.2.10...v3.2.11)

---
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-13 08:55:09 -07:00
dependabot[bot]
5b31e019cf github: bump github/codeql-action from 2.1.15 to 2.1.16
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.15 to 2.1.16.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](3f62b754e2...3e7e3b32d0)

---
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-07-13 08:54:19 -07:00
dependabot[bot]
f2de0c5edf cargo: bump clap from 3.2.8 to 3.2.10
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.8 to 3.2.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/v3.2.8...v3.2.10)

---
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-12 11:19:07 -07:00
Martin von Zweigbergk
b84be06c08 conflicts: minimize diffs in materialized conflicts
One advantage of our conflict marker style (compared to the usual
3-way markers) is that they provide the user with the diff between the
base and one side so the user doesn't have to do that in their head
(which is how I use 3-way markers anyway). However, since we currently
always use the "first" side for the diff, that diff can be larger than
if we had picked the other side, which makes the marker style worse
than the usual 3-way markers. This has bothered me many times and it's
about time we fix it.
2022-07-12 07:46:45 -07:00
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