Commit graph

1103 commits

Author SHA1 Message Date
Martin von Zweigbergk
9e6e5f3d54 cli: make functions delegating to subcommand a single expression 2022-03-23 15:17:21 -07:00
Martin von Zweigbergk
66fe23b4e9 cli: switch from clap's Builder API to its Derive API
The Derive API is easier to work with, less error-prone, and less
verbose, so it seems like a good improvement.

It was quite a bit of work to make the switch, and I'll be surprised
if I didn't make any mistakes in the translation. We unfortunately
don't have enough e2e tests to be very confident, so we'll have to fix
any problems as we discover them.

I've at least verified that the output of `jj debug completion --fish`
is unchanged, except for a few help texts I changed for different
reasons (consistency, clarity, avoiding redundancy).
2022-03-23 15:17:21 -07:00
Martin von Zweigbergk
11afbc70f9 cli: delete unimplemented jj debug writeworkingcopy command
I deleted the implementtion a long time ago, but I forgot to remove it
from the `clap::Command`.
2022-03-23 15:17:21 -07:00
Martin von Zweigbergk
bf62e1789f cargo: update lock file
With the current dependencies in the lock file, we cannot use `clap`'s
"derive" feature, which I'd like to do.
2022-03-23 15:17:21 -07:00
Martin von Zweigbergk
2f59e8b68a cli: respect $NO_COLOR environment variable 2022-03-23 09:57:42 -07:00
Martin von Zweigbergk
7ba1c6bdb6 config: add support for a $JJ_CONFIG environment variable
It's useful for tests, scripts, and debugging to be able to use
specific config instead of the user's config. That's especially true
for our automated tests because they didn't have a place to read
config from on Windows before this patch (they read their config from
`{FOLDERID_RoamingAppData}`, which I don't think we can override in
tests).
2022-03-23 09:57:42 -07:00
Martin von Zweigbergk
3b507e4a2e config: use platform-specific directory separator in jj/config.toml
I don't know if Windows actually cares, but it seems more correct this
way.
2022-03-23 09:57:42 -07:00
Martin von Zweigbergk
095fb9fef4 config: drop support for ~/.jjconfig
I'm a little hesitant to do this because most tools I'm familiar with
have the config file directly in `~/`. It's also easier to describe
where to put the file if it doesn't vary across platforms. But we're
still early in the project, so let's try it and see if we get any
complaints.
2022-03-23 09:57:42 -07:00
Martin von Zweigbergk
1d3f909a3b config: move reading of config from lib crate to CLI crate
The library crate should be usable by e.g. server processes, so it
should not read from the current user's home directory.
2022-03-23 09:57:42 -07:00
Martin von Zweigbergk
eff615998f github: add reminder in PR template about updating the changelog 2022-03-23 09:57:42 -07:00
dependabot[bot]
302b4025d5 cargo: bump test-case from 2.0.0 to 2.0.1
Bumps [test-case](https://github.com/frondeus/test-case) from 2.0.0 to 2.0.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.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 09:33:22 -07:00
Martin von Zweigbergk
b4e6fab1af github: restrict Clippy's access again
It seems "checks" is the permissions it needs to be able to comment on
pull-requests.
2022-03-18 22:51:25 -07:00
Martin von Zweigbergk
3f24411bbf cargo: upgrade the config crate from 0.11.0 to 0.12.0
This required a bit of work.
2022-03-18 22:33:04 -07:00
dependabot[bot]
36a575ccbf github: bump actions-rs/cargo from 1.0.1 to 1.0.3
Bumps [actions-rs/cargo](https://github.com/actions-rs/cargo) from 1.0.1 to 1.0.3.
- [Release notes](https://github.com/actions-rs/cargo/releases)
- [Changelog](https://github.com/actions-rs/cargo/blob/master/CHANGELOG.md)
- [Commits](ae10961054...844f36862e)

---
updated-dependencies:
- dependency-name: actions-rs/cargo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 08:53:12 -07:00
dependabot[bot]
bde79f7a60 github: bump actions-rs/toolchain from 1.0.6 to 1.0.7
Bumps [actions-rs/toolchain](https://github.com/actions-rs/toolchain) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/actions-rs/toolchain/releases)
- [Changelog](https://github.com/actions-rs/toolchain/blob/master/CHANGELOG.md)
- [Commits](b2417cde72...16499b5e05)

---
updated-dependencies:
- dependency-name: actions-rs/toolchain
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 08:45:06 -07:00
Martin von Zweigbergk
53721f7d25 github: pin cachix/install-nix-action version by hash 2022-03-17 09:19:12 -07:00
Martin von Zweigbergk
23c92ccf45 github: pin actions-rs/clippy-check version by hash 2022-03-17 09:19:12 -07:00
Martin von Zweigbergk
de56053531 github: pin actions-rs/toolchain version by hash 2022-03-17 09:19:12 -07:00
Martin von Zweigbergk
d6967fd690 github: pin actions/upload-release-asset version by hash 2022-03-17 09:19:12 -07:00
Martin von Zweigbergk
13f7354cfe github: pin actions-rs/cargo version by hash 2022-03-17 09:19:12 -07:00
Martin von Zweigbergk
b36e50c09d github: pin actions/checkout version by hash 2022-03-17 09:19:12 -07:00
Martin von Zweigbergk
cc13a2ec84 release: include the two recent no-op releases in the changelog
I keep forgetting to update things while doing a release...
2022-03-17 06:03:10 -07:00
dependabot[bot]
4fab28ffc6 github: bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 22:57:55 -07:00
Martin von Zweigbergk
2a76572653 docs: add pointer to pre-built binary releases (#73)
Users now have the option of installing from source or directly
installing a binary.

I also corrected some text that effectively said that installing a Nix
flake is not installing from source, but I think it actually does
install from source.
2022-03-16 22:57:38 -07:00
dependabot[bot]
30e3685f5e cargo: bump regex from 1.5.4 to 1.5.5
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.4 to 1.5.5.
- [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.4...1.5.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 22:57:09 -07:00
dependabot[bot]
f14b1260e5 cargo: bump rand from 0.8.4 to 0.8.5
Bumps [rand](https://github.com/rust-random/rand) from 0.8.4 to 0.8.5.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.4...0.8.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 22:27:45 -07:00
dependabot[bot]
85d4ac7d47 cargo: bump clap from 3.1.2 to 3.1.6
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.2 to 3.1.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.1.2...v3.1.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-03-16 22:12:52 -07:00
dependabot[bot]
a8f881b84c cargo: bump test-case from 1.2.3 to 2.0.0
Bumps [test-case](https://github.com/frondeus/test-case) from 1.2.3 to 2.0.0.
- [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/v1.2.3...v2.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 22:07:44 -07:00
dependabot[bot]
5f3877fc6b github: bump actions/upload-release-asset from 1.0.1 to 1.0.2
Bumps [actions/upload-release-asset](https://github.com/actions/upload-release-asset) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/actions/upload-release-asset/releases)
- [Commits](https://github.com/actions/upload-release-asset/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: actions/upload-release-asset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:56:45 -07:00
dependabot[bot]
3f7daa6b04 github: bump actions/upload-artifact from 2.3.1 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](82c141cc51...6673cd052c)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:55:06 -07:00
dependabot[bot]
c8b32238f9 cargo: bump zstd from 0.10.0+zstd.1.5.2 to 0.11.1+zstd.1.5.2
Bumps [zstd](https://github.com/gyscos/zstd-rs) from 0.10.0+zstd.1.5.2 to 0.11.1+zstd.1.5.2.
- [Release notes](https://github.com/gyscos/zstd-rs/releases)
- [Commits](https://github.com/gyscos/zstd-rs/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:52:29 -07:00
dependabot[bot]
65bc87f57d cargo: bump serde_json from 1.0.78 to 1.0.79
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.78 to 1.0.79.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.78...v1.0.79)

---
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-03-16 21:52:06 -07:00
dependabot[bot]
b56435d609 cargo: bump indoc from 1.0.3 to 1.0.4
Bumps [indoc](https://github.com/dtolnay/indoc) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.3...1.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:51:53 -07:00
dependabot[bot]
fae61bad79 cargo: bump blake2 from 0.10.2 to 0.10.4
Bumps [blake2](https://github.com/RustCrypto/hashes) from 0.10.2 to 0.10.4.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:51:29 -07:00
dependabot[bot]
51b12ff4b4 github: bump github/codeql-action from 1.0.26 to 1.1.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.26 to 1.1.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](5f53256358...8834766498)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:42:18 -07:00
dependabot[bot]
d90e7b93e8 github: bump cachix/install-nix-action from 14.1 to 16
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 14.1 to 16.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v14.1...v16)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:41:20 -07:00
dependabot[bot]
2fdd8bc60b cargo: bump clap_complete from 3.1.0 to 3.1.1
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.1.0 to 3.1.1.
- [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.0...clap_complete-v3.1.1)

---
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-03-16 21:37:27 -07:00
dependabot[bot]
0ea6f47dc5 cargo: bump textwrap from 0.14.2 to 0.15.0
Bumps [textwrap](https://github.com/mgeisler/textwrap) from 0.14.2 to 0.15.0.
- [Release notes](https://github.com/mgeisler/textwrap/releases)
- [Changelog](https://github.com/mgeisler/textwrap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mgeisler/textwrap/compare/0.14.2...0.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 21:31:22 -07:00
Martin von Zweigbergk
8b6932f837 github: add a dependabot config
This was another security recommendation for projects by Google
employees.
2022-03-16 21:09:01 -07:00
Martin von Zweigbergk
b5659ec680 github: give Clippy action full permissions
I've found it hard to figure out which actions need which
permissions. GitHub doesn't seem to even document what the permissions
mean. So let's just give Clippy full access.
2022-03-16 20:28:54 -07:00
Martin von Zweigbergk
af76631021 github: set top-level permissions to readonly for all workflows
The new code scanner is complaining that actions have permissions to
do too much. It wasn't obvious to me what permissions the jobs need,
but let's see how this works.
2022-03-16 19:59:08 -07:00
Martin von Zweigbergk
168d986827 release: bump version to 0.3.3 (skipping 0.3.2)
I forgot to bump the version to 0.3.2 before tagging and releasing it,
so the released 0.3.2 has version number 0.3.1 in the source code and
(therefore) reported from `jj --version`. I'm therefore bumping it
from 0.3.1 to 0.3.3 now, so there can be a matching 0.3.3 release.
2022-03-16 12:20:52 -07:00
Martin von Zweigbergk
73a0f72ffa github: new attempt at setting up automated release builds (#73)
My attempt at using rust-build/rust-build.action for release builds
(from bf21e65c5d) initially seemed promising. However, the produced
musl binary build segfaulted on my Debian machine. I don't know about
the Mac and Windows binaries. I then tried switching to building with
a vendored OpenSSL (cac93e2793), but then the build started failing
(https://github.com/martinvonz/jj/actions/runs/1978730621). I couldn't
figure out why it failed, so I decided to do the build in a more
manual way (without rust-build/rust-build.action), based on
https://github.com/gitext-rs/git-stack/blob/main/.github/workflows/post-release.yml
(thanks to @epage for the example and to @arxanas for the link). I
could simplify it a bit because I'm currently doing the releases via
the GitHub UI (epage's original triggers the release when a tag has
been pushed, IIUC). Let's hope that it works this time.
2022-03-16 11:25:59 -07:00
Martin von Zweigbergk
a8f334dc35 github: add OSSF Scorecards security scanner
This is a new recommendation for GitHub projects by Google employees.
2022-03-15 09:47:11 -07:00
Martin von Zweigbergk
a46bda3d49 release: update release notes for 0.3.1
I forgot to do this when I bumped the version number.
2022-03-13 21:54:45 -07:00
Martin von Zweigbergk
794e956a84 release: bump version to 0.3.1
This release is just to get #131 out and to see if the automated
release builds work now that we use a vendored OpenSSL from libgit2.
2022-03-13 21:49:09 -07:00
Martin von Zweigbergk
cac93e2793 cargo: use libgit2 with vendored OpenSSL (#73)
I was able to build a working musl binary with this change, by running
this command:

```
cargo build --release --target x86_64-unknown-linux-musl
```

Thanks to @arxanas for the tip.
2022-03-13 21:34:07 -07:00
Martin von Zweigbergk
c14e138698 cli: expand ~ in core.excludesFile, don't crash when missing
I thought that `std::fs::canonicalize()` expanded "~", but it doesn't
seem to do that, which caused #131. Git seems to do the expansion
itself, so we probably also should. More importantly
`std::fs::canonicalize()` crashes when the file doesn't exist. The
manual expansion we do now does not.

Closes #131.
2022-03-13 12:40:37 -07:00
Martin von Zweigbergk
43e1f42c63 github: include version number in issue template again
Now that we have a changelog and I plan to do releases once in a
while, it makes sense again to have the version number in the issue
template.
2022-03-12 23:34:37 -08:00
Martin von Zweigbergk
1777d85550 release: add a changelog 2022-03-12 23:03:01 -08:00