Yuya Nishihara
ba087f9350
diff: remove unneeded mutation of histogram
...
The iterator might look a bit involved, but it clarifies that we never combine
words from different buckets.
2024-07-09 20:35:36 +09:00
dependabot[bot]
774769a00a
cargo: bump the cargo-dependencies group with 3 updates
...
Bumps the cargo-dependencies group with 3 updates: [async-trait](https://github.com/dtolnay/async-trait ), [serde](https://github.com/serde-rs/serde ) and [syn](https://github.com/dtolnay/syn ).
Updates `async-trait` from 0.1.80 to 0.1.81
- [Release notes](https://github.com/dtolnay/async-trait/releases )
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.80...0.1.81 )
Updates `serde` from 1.0.203 to 1.0.204
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204 )
Updates `syn` from 2.0.68 to 2.0.69
- [Release notes](https://github.com/dtolnay/syn/releases )
- [Commits](https://github.com/dtolnay/syn/compare/2.0.68...2.0.69 )
---
updated-dependencies:
- dependency-name: async-trait
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: serde
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 22:16:57 -05:00
Scott Taylor
a983abb594
cli_util: short-prefixes for commit summary in transaction
...
I've run into change ID prefixes being 4-5 characters instead of the
usual 1-2 characters in commands like `jj duplicate` and `jj split`
fairly often, and it seems like this should resolve that.
2024-07-08 08:23:39 -05:00
Scott Taylor
ddfce6d2c9
cli_util: extract new_id_prefix_context
method
2024-07-08 08:23:39 -05:00
Yuya Nishihara
8bf10c8289
revset: update tests to not require private field access to err.kind
2024-07-08 10:44:43 +09:00
Vladimir Petrzhikovskii
802d2f5327
cli: recursively create clone destination path
2024-07-07 23:02:41 +02:00
Benjamin Tan
cd41bc3584
backout: accept multiple revisions to back out
...
Closes #3339 .
2024-07-07 17:58:10 +08:00
dependabot[bot]
4b0cd02b5f
build(deps-dev): bump certifi from 2024.2.2 to 2024.7.4
...
Bumps [certifi](https://github.com/certifi/python-certifi ) from 2024.2.2 to 2024.7.4.
- [Commits](https://github.com/certifi/python-certifi/compare/2024.02.02...2024.07.04 )
---
updated-dependencies:
- dependency-name: certifi
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-07-06 05:53:21 +01:00
Yuya Nishihara
5c649e734d
cli: show commit summary at end of "branch set"
...
For the same reason as the previous commit.
Created and moved stats are printed separately because it's unusual to do both
within one "branch set" invocation.
2024-07-06 10:12:43 +09:00
Yuya Nishihara
a5095c1da6
cli: show commit summary at end of "branch create"
...
For the same reason as cdc0cc3601
. This will help notice problems like wrong
target revision.
The warning for multiple branches is reorganized as a hint for "-r" option,
which I think is the main purpose of this warning. Unlike "squash", we don't
check if an argument can be parsed as a revset because branch name is usually
a valid symbol expression.
2024-07-06 10:12:43 +09:00
Yuya Nishihara
e02c576282
cli: print branch update stats within transaction
...
It's weird that export failure was emitted before the branch changes. Spotted
while adding "Created N branches" stats.
2024-07-06 10:12:43 +09:00
dependabot[bot]
9594a5c4a6
github: bump actions/upload-artifact in the github-dependencies group
...
Bumps the github-dependencies group with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact ).
Updates `actions/upload-artifact` from 4.3.3 to 4.3.4
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](65462800fd...0b2256b8c0
)
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: github-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 23:58:38 +08:00
Benjamin Tan
d2eb4d9b56
backout: include backed out commit's subject in new commit
2024-07-05 17:11:37 +08:00
Benjamin Tan
82bab36c0e
backout: inline rewrite::back_out_commit
2024-07-05 17:11:37 +08:00
Benjamin Tan
456356aacb
backout: add initial tests
2024-07-05 17:11:37 +08:00
Yuya Nishihara
44a39017f0
diff: highlight word-level changes in git diffs
...
The output looks somewhat similar to color-words diffs. Unified diffs are
verbose, but are easier to follow if adjacent lines are added/removed + modified
for example.
Word-level diffing is forcibly enabled. We can also add a config knob (or
!color condition) to turn it off to save CPU time.
I originally considered disabling highlights in block insertion/deletion, but
that wasn't always great. This can be addressed separately as it also applies
to color-words diffs. #3958
2024-07-05 16:07:12 +09:00
Yuya Nishihara
9e8a739e4d
diff: deduplicate write() calls in show_unified_diff_hunks()
...
I'm going to add word-level highlighting there.
2024-07-05 16:07:12 +09:00
Scott Taylor
54877e1f79
workspace: abandon discardable working copy on forget
...
Forgetting a workspace removes its working-copy commit, so it makes
sense for it to be abandoned if it is discardable just like editing a
new commit will cause the old commit to be abandoned if it is
discardable.
2024-07-04 19:37:56 -05:00
Scott Taylor
622b606bfb
repo: abandon working copy only if no other workspaces reference it
...
Currently, if two workspaces are editing the same discardable commit and
one of them switches to editing a different commit, it is abandoned even
though the other workspace is still editing it. This commit treats
workspaces as referencing their working-copy commits so that they won't
be abandoned.
2024-07-04 19:37:56 -05:00
Scott Taylor
b583075396
repo: extract maybe_abandon_wc_commit
method
2024-07-04 19:37:56 -05:00
Scott Taylor
fa398ab405
cli: fix typo in jj workspace
help
2024-07-04 19:37:56 -05:00
Yuya Nishihara
1cae93ce27
cli: rephrase hint for updating just one branch by "branch move"
...
Suggested by Ilya.
2024-07-05 07:58:18 +09:00
Yuya Nishihara
cdc0cc3601
cli: show commit summary at end of "branch move"
...
It's nice to see the result of "branch move", "create", etc., and this is more
important in "branch move" because the source branches can be specified in an
abstracted way. I originally considered printing a list of affected branches,
but it looked rather verbose. Since the destination revision is unique, we can
use commit_summary template instead.
This patch also removes a warning about multiple branches because the branch
names are included in the commit summary. I think the hint message is good
enough to signal possible mistake.
2024-07-05 07:58:18 +09:00
Benjamin Tan
0c0e001262
git init: add revset alias for trunk()
when intializing with existing git repository
2024-07-04 23:04:19 +08:00
Benjamin Tan
d8899e1ae7
git clone: add revset alias for trunk()
2024-07-04 23:04:19 +08:00
Yuya Nishihara
79569f8248
changelog: move "rebase --skip-emptied" entry to unreleased section
2024-07-04 22:38:43 +09:00
Austin Seipp
c535b1c50d
cargo: remove unused ouroboros
dependency
...
I saw this while looking over the Cargo file and remembered Martin removed usage
of this a while back.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-07-03 19:27:22 -07:00
Matt Stark
31ac0d7e1f
feat(rebase): Rename --skip-empty to --skip-emptied.
...
This is based on @martinvonz's comment in #3830 about the inconsistency between squash --keep-emptied and rebase --skip-empty.
2024-07-04 12:13:02 +10:00
Yuya Nishihara
034859b52f
cli: branch: print stats even if just one branch is updated
...
We usually print stats at the end of mutable operation, and I think these
messages are useful even if N = 1. I understand that "Deleted N" (N > 1) is
unusual and the original intent of these messages was to signal possible
mistakes. However, I don't think printing N=1 stats would nullify the original
purpose.
No emptiness check is needed for delete/forget, but names can be empty in
track/untrack because of noop changes.
2024-07-04 10:58:50 +09:00
mlcui
c256ad8a0a
windows: avoid UNC paths in run_ui_editor
...
See #3986 for more details. This is a no-op for non-Windows.
2024-07-04 11:30:20 +10:00
Matt Kulukundis
3c07d10c5b
fix: fix change notes to move something from 0.19 to future
2024-07-03 20:53:40 -04:00
Matt Kulukundis
df8202af4e
copy-tracking: initial implementation GitBackend::get_copy_records
2024-07-03 20:26:30 -04:00
Matt Kulukundis
2917dea0a1
copy-tracking: add a command line driver with a simple test
2024-07-03 20:26:30 -04:00
Matt Kulukundis
dab8a29683
copy-tracking: stub get_copy_records
...
- add the method and types for all backends
2024-07-03 20:26:30 -04:00
Matt Kulukundis
067d37aa3c
copy-tracking: cargo add gix-format and gix diff-blob feature
2024-07-03 20:26:30 -04:00
Matt Kulukundis
aaa99e6dc7
diff: add a file-by-file variant for external diff tools
2024-07-03 20:09:17 -04:00
Skyler Grey
5de0ae84cd
cargo: bump gix-actor to v0.31.4
...
Gitoxide, which is used to parse git commits, previously failed to parse
some malformed author/committer lines.
In 0.31.4, this parsing was made more lenient so as to better match
Git's parsing and avoid breaking on "in-the-wild" repositories such as
https://github.com/LibreOffice/core
Refs: https://github.com/Byron/gitoxide/issues/1438
Fixes: https://github.com/martinvonz/jj/issues/4008
2024-07-03 23:53:38 +01:00
Austin Seipp
74c275ed10
release: version 0.19.0
...
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-07-03 14:37:40 -07:00
Austin Seipp
30bb90e417
changelog: minor touchups
...
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-07-03 14:37:40 -07:00
Matt Stark
a840894a02
fix(changelog): Move --keep-emptied to the correct release.
...
Thanks @scott2000 for catching this.
2024-07-04 01:15:13 +10:00
Yuya Nishihara
455daa4d67
cli: remove deprecated --allow-large-revsets flag at all
...
It's been deprecated since v0.9.0 (2023-09-06). This patch doesn't add
changelog entry because the use of --allow-large-revsets was hard error.
2024-07-03 23:06:26 +09:00
Matt Stark
ca4eb60426
feat(squash): Add --keep-emptied
flag
...
Fixes #3815
2024-07-03 12:03:26 +10:00
Matt Stark
7682a038a1
chore: Make squash tests log empty commits.
2024-07-03 12:03:26 +10:00
Scott Taylor
e54ecefbd4
commit: add --reset-author
option
2024-07-02 18:21:21 -05:00
dependabot[bot]
b06b65b355
cargo: bump the cargo-dependencies group with 3 updates
...
Bumps the cargo-dependencies group with 3 updates: [pest](https://github.com/pest-parser/pest ), [pest_derive](https://github.com/pest-parser/pest ) and [serde_json](https://github.com/serde-rs/json ).
Updates `pest` from 2.7.10 to 2.7.11
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/compare/v2.7.10...v2.7.11 )
Updates `pest_derive` from 2.7.10 to 2.7.11
- [Release notes](https://github.com/pest-parser/pest/releases )
- [Commits](https://github.com/pest-parser/pest/compare/v2.7.10...v2.7.11 )
Updates `serde_json` from 1.0.119 to 1.0.120
- [Release notes](https://github.com/serde-rs/json/releases )
- [Commits](https://github.com/serde-rs/json/compare/v1.0.119...v1.0.120 )
---
updated-dependencies:
- dependency-name: pest
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: pest_derive
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: serde_json
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 16:01:17 +00:00
Yuya Nishihara
f9a15ba542
diff: do not add excessive number of context lines to last unified-diff hunk
...
The last hunk could be truncated instead, but the .peekable() version is easier
to follow. If we truncated lines, we would have to adjust line ranges
accordingly.
2024-07-02 18:49:52 +09:00
Yuya Nishihara
ec709e7f8b
diff: rely on emptiness of unified hunk lines whether to append "after" context
...
show_context_after was set once when DiffHunk::Different received, and was
never turned off. This means DiffHunk::Matching is not supposed to repeat.
Under this condition, we can assume that removed/added lines exist if lines
isn't empty.
2024-07-02 18:49:52 +09:00
Yuya Nishihara
318f594291
diff: simplify context line extraction by using DoubleEndedIterator
2024-07-02 18:49:52 +09:00
Yuya Nishihara
3d458c3e58
diff: extract helpers that push unified-diff hunk lines
2024-07-02 18:49:52 +09:00
Yuya Nishihara
a4f5462d07
tests: add test for leading/trailing diff context lines
2024-07-02 18:49:52 +09:00