ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

1157 commits

Author SHA1 Message Date
Martin von Zweigbergk
6747a6c59c cli: add test of --no-commit-working-copy
I didn't add a test in #90 because the test cases needed to be cleaned
up first. They now look a bit better, so we can add test for the
flag.
2022-03-02 22:00:24 -08:00
Martin von Zweigbergk
834349a971 tests: add helper for matching regex and capturing groups 2022-03-02 22:00:24 -08:00
Martin von Zweigbergk
711f65303c tests: use assert_cmd for e2e tests
I didn't know about `assert_cmd` when I wrote the few e2e tests we
have. Let's switch to it and remove our own similar helpers.
2022-03-02 22:00:24 -08:00
Martin von Zweigbergk
b1301fd761 tests: work around intellij-rust/intellij-rust#5368
The new `.editorconfig` tells editors to strip trailing whitespace,
but IntelliJ has a bug where it strips trailing whitespace even inside
multi-line strings. We can work around it in the cases we have because
they're regexes, so `[ ]` works as a space.
2022-03-02 22:00:24 -08:00
Martin von Zweigbergk
fbd376df43 docs: mention that libssl-dev and openssl are needed for installation
Closes #75.
2022-03-02 18:38:36 -08:00
Martin von Zweigbergk
78dadcc1ba docs: restructure installation instructions to be per platform
The only overlap between the instructions for Linux, Mac, and Windows
is the `cargo install` step, so let's instead split it up so it's easy
for the user to skip to the relevant part, especially as we add more
platform-specific instructions.

I promoted some sections to one level higher sections to try to
clarify that the initial configuration and the command-line completion
applies to all platforms.
2022-03-02 18:38:36 -08:00
Martin von Zweigbergk
59eee7e918 cli: don't print "Working copy now at:" when it's unchanged
When I recently changed the working copy to not have a commit ID
(e098c01935), I lost the check in `update_working_copy()` in
`commands.rs` that made us not print "Working copy now at: " if the
commit was unchanged. Now we always print, which is unnecessary and
confusing (it makes it seem like the commit changed even if it
didn't). Let's restore the check.
2022-03-02 13:16:10 -08:00
Cole Mickens
2a6ab8b6fc nix: add manpages, completion to output 2022-03-02 08:46:54 -08:00
Cole Mickens
8cdfc81cc2 commands: add clap_mangen support 2022-03-02 08:46:54 -08:00
Cole Mickens
e5043c2ace cargo: add clap_mangen 2022-03-02 08:46:54 -08:00
Martin von Zweigbergk
384aa95901 github: update PR template to explain expectations
I think I got the current template from Google's open-sourcing
process, but I don't care about most of it (GitHub actions already
check that tests pass, for example). Let's instead tell contributors
that they don't need to write anything at all there and that they
should describe the changes in the commit message(s) instead.
2022-03-02 08:11:31 -08:00
Martin von Zweigbergk
0f245437a8 github: put repro steps first in issue template
I agree with @unrelentingtech's comment in #54 that the steps to
reproduce should come before the expected and actual behavior. I don't
know where I got the current template from. I think it was from
Google's process for open-sourcing the project.

I also removed the version field from the template for now since I
haven't started updating it regularly yet. I should start doing that.
2022-03-01 23:25:41 -08:00
Martin von Zweigbergk
e11e373427 docs: describe how to set up completion for each shell
Setting up completion is particularly non-obvious for Zsh, so let's
provide the exact command(s) for each supported shell.

Closes #67.
2022-02-28 19:35:06 -08:00
Martin von Zweigbergk
70811669fc docs: remove $ from shell scripts for easy copy&paste 2022-02-28 19:35:06 -08:00
Martin von Zweigbergk
c59dcd76a4 cargo: upgrade clap to 3.1.0
This avoids some deprecation warnings from `cargo install` (which
picks the latest version instead of the locked version by default).
2022-02-27 13:16:02 -08:00
Martin von Zweigbergk
1978a7d038 docs: use stable Rust toolchain for installation
We don't need the nightly toolchain anymore since #70 (thanks,
@arxanas!).
2022-02-27 12:49:00 -08:00
Martin von Zweigbergk
a88865a418 cli: add an option to avoid committing the working copy
It can be useful in command prompts and scripts to be able to quickly
get e.g. the `jj status` output without spending time committing the
working copy (perhaps because some background process continuously
commits the working copy). One can already do that by passing
`--at-op=<operation ID>`, but then one needs to look up the operation
ID first. That is both extra work for the user/script and it means
there's an extra `jj op log` invocation to get the operation ID. Let's
have a global flag to make it easy and efficient to do.
2022-02-27 12:12:24 -08:00
Martin von Zweigbergk
1a0b5b9c9e docs: mention user-specific config path on different platforms
Since #85, we load the user's config from a path under
`dirs::config_dir()`. It's probably not obvious to all users where to
put the file, so let's describe that. (I didn't know where to put the
file on my Mac until I looked at the function's documentation.)
2022-02-27 11:48:45 -08:00
Martin von Zweigbergk
648cfd698c cleanup: run rustfmt 2022-02-27 10:59:28 -08:00
Matthew L Daniel
88cc9ffcbc Fix a link from 423a894 2022-02-26 00:15:53 -08:00
Cole Mickens
fbe8eb47db lib/settings: try to load from platform config_dir 2022-02-26 00:09:34 -08:00
Waleed Khan
76974a9050 build: suppress unstable_name_collisions warnings on stable
Originally, I had thought that these warnings would only potentially show up in nightly because there was a feature which exposed these functions, and we would be able to enable that feature and conditionally not define the conflicting methods. But it looks like these warnings also show up in stable. I've just suppressed each of them individually. Other options would be to rename them and just make them wrapper methods, or to disable `unstable_name_collisions` warnings at a higher scope (possibly including at the crate level).
2022-02-23 23:41:55 -08:00
Waleed Khan
38aee9f749 ci: add Clippy stable check
Currently, `main` has Clippy lint warnings on stable, but not on nightly.
2022-02-23 23:41:55 -08:00
Martin von Zweigbergk
f9298582a7
Merge pull request #71 from pingiun/remove-rust-overlay
Remove rust nightly nix overlay
2022-02-21 09:28:23 -08:00
Jelle Besseling
54a6adf47a
Remove rust nightly overlay 2022-02-21 18:14:48 +01:00
Martin von Zweigbergk
5e7f69c4e8
Merge pull request #70 from arxanas/stable-rust
Support stable Rust
2022-02-21 03:17:03 -08:00
Waleed Khan
b011805fc7 ci: use stable Rust for builds
We still use nightly Clippy to ensure that 1) it builds under nightly and 2) that we pick up any new lints.
2022-02-20 22:21:14 -08:00
Waleed Khan
9202aae8b1 build: conditionally use map_first_last feature if available 2022-02-20 22:21:14 -08:00
Waleed Khan
dd3272fe90 build: use assert_matches crate
The `assert_matches` feature is nightly-only, so use this crate as a shim.
2022-02-20 22:21:14 -08:00
Waleed Khan
75480c2bdc build: migrate diff_bench to criterion
Benchmarking is currently nightly-only, so to get `jujutsu` to build on stable, we need to use a stable benchmarking library.
2022-02-20 22:21:14 -08:00
Waleed Khan
261cd1a1c4 build: add shims for nightly feature map_first_last 2022-02-20 22:16:07 -08:00
Waleed Khan
325eb4f4ca Add .editorconfig
This file sets formatting defaults for editors. See https://editorconfig.org/.
2022-02-20 22:16:07 -08:00
Martin von Zweigbergk
c3a5ea0062
Merge pull request #66 from pingiun/add-flake
Add flake.nix
2022-02-20 15:33:50 -08:00
Jelle Besseling
9fb580b6ee
Add nix installation instructions 2022-02-20 22:53:04 +01:00
Jelle Besseling
e25752c746
Add updateToolchainManifest explanation 2022-02-20 21:56:52 +01:00
Jelle Besseling
e3d40a1904
Add comment about nix build 2022-02-20 21:49:54 +01:00
Jelle Besseling
dde64d244a
Add generated attributes 2022-02-20 21:49:44 +01:00
Jelle Besseling
f8ef71cfa7
Fix program name 2022-02-20 21:49:15 +01:00
Jelle Besseling
327ea5390d
Add nix check workflow 2022-02-20 21:48:51 +01:00
Jelle Besseling
50b8357234
Add flake.nix 2022-02-20 21:30:05 +01:00
Martin von Zweigbergk
2916cb2d9f cli: exit with code 1 on invalid config
This should have been part of the previous commit (fix for #55).
2022-02-19 23:45:41 -08:00
Martin von Zweigbergk
108b785a36 cli: don't panic on invalid config
If `~/.jjconfig` is invalid, we currently simply panic. That results
in a poor error message. We should handle the error instead.

Closes #55.
2022-02-19 23:38:23 -08:00
Martin von Zweigbergk
f4cadff6e1 README: description additional installation steps for Mac
I'm not sure which steps are needed and what they depend on (I didn't
need the `pkg-config` bits), so the steps are a little vague for now.

Closes #62.
2022-02-19 23:23:58 -08:00
Martin von Zweigbergk
4a0bd07e8c README: add note about use of libgit2 C library
Closes #56.
2022-02-19 22:55:48 -08:00
Martin von Zweigbergk
d9b364442e cleanup: update references to .jj/store/git to .jj/repo/store/git
The `store/` directory (and many others) recently moved into
`.jj/repo/`, but I forgot to update a few places.
2022-02-17 22:44:14 -08:00
Martin von Zweigbergk
7c247116b9 repo: remove code for upgrading old repos to have .jj/store/git/
1b6efdc3f8 moved `.jj/git/` into `.jj/store/` for consistency with
the layout of native stores. It provided automatic format upgrades for
repos with the old format. It's been about four months now, so let's
remove the migration code.
2022-02-17 22:44:05 -08:00
Martin von Zweigbergk
1eb913d444 cli: when setting git HEAD in collocated repo, also update own record
When running in a working copy collocated with git's, we export the
working copy's commit's parent to git after every command. However, we
forgot to update our own record of git's HEAD. That means that on
subsequent imports from git, it'll look like the user had updated HEAD
using a git command. When we detect that, we trust that the user had
taken care of the changes in the working copy and we simply abandon
our old working copy commit. That led to the bug reported in $54,
where the second commit of a `jj split` got lost.

The fix is to also update our record of where git's HEAD is when we
tell git to update it.

Closes #54.
2022-02-17 22:12:30 -08:00
Martin von Zweigbergk
03e6b8c0e6 working_copy: take Tree, not CommitId, as argument to check_out()
We no longer need the commit ID, so we shouldn't make the callers pass
it. This lets us simplify several tests, because they no longer to
create commits just to check out a tree in the working copy.
2022-02-13 12:14:34 -08:00
Martin von Zweigbergk
315e5e87a3 working_copy: take a tree object instead of ID in TreeState::check_out()
The callers mostly have the tree object available anyway.
2022-02-13 12:12:08 -08:00
Martin von Zweigbergk
00c9a1ae11 working_copy: stop taking commit ID in LockedWorkingCopy::finish()
We used to use the value to detect races, but we use the tree ID and
the operation ID these days, so we don't need the commit ID.

By changing this, we can avoid creating some commit IDs in tests,
which is why I tackled this issue now.
2022-02-12 23:48:06 -08:00