Martin von Zweigbergk
0d1ff8a150
merged_tree: propagate errors from TreeEntriesIterator
...
We shouldn't panic if we fail to read a tree from the backend.
2024-05-01 06:10:08 -07:00
Martin von Zweigbergk
7093d5d359
squash: don't use unchanged source commit as predecessor
2024-04-30 20:03:57 -07:00
Martin von Zweigbergk
09b960538a
squash: don't rewrite commits that didn't change
...
Closes #3334
2024-04-30 20:03:57 -07:00
Martin von Zweigbergk
2bd2358d6a
squash: move updating of source commits out of diff-editing loop
...
This is just a little refactoring to prepare for using
`transform_descendants()`.
2024-04-30 20:03:57 -07:00
Martin von Zweigbergk
7319479df9
squash: decide to abandon source commit if entire diff was selected
...
Before this patch, we would abandon the source commit if it became
empty after applying the reverse diff. This changes that condition to
the equivalent condition of the selected tree being the source
commit's original tree. This will help us rewrite the code to use
`transform_descendants()`.
2024-04-30 20:03:57 -07:00
Martin von Zweigbergk
dbf2a98903
rewrite: add CommitRewriter::record_abandoned_commit()
...
We already have two uses for this function and I think we're soon
going to have more.
The function record the old commit as abandoned with the new parents,
which is typically what you want. We could record it as abandoned with
the old parents instead but then we'd have to do an extra iteration to
find the parents when rebasing any children. It would also be
confusing if
`rewriter.set_parents(new_parents).record_abandoned_commit()` didn't
respect the new parents.
2024-04-30 20:03:57 -07:00
Martin von Zweigbergk
8c2c319f77
squash: add more tests of no-op squashing
...
We didn't have any tests with `jj squash` with multiple source commits
and no matching paths.
2024-04-30 20:03:57 -07:00
Benjamin Tan
f1f84544fb
rebase: do not print out commit summaries of skipped commits
2024-05-01 01:35:25 +08:00
dependabot[bot]
b8e08d644c
cargo: bump libc from 0.2.153 to 0.2.154 in the cargo-dependencies group
...
Bumps the cargo-dependencies group with 1 update: [libc](https://github.com/rust-lang/libc ).
Updates `libc` from 0.2.153 to 0.2.154
- [Release notes](https://github.com/rust-lang/libc/releases )
- [Commits](https://github.com/rust-lang/libc/compare/0.2.153...0.2.154 )
---
updated-dependencies:
- dependency-name: libc
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 15:45:51 +00:00
Jonathan Lorimer
e54e83b0f5
docs: Add information about configuring delta pager
...
docs: Add information about configuring delta pager
docs: only mention pager, not diff
2024-04-29 10:22:05 -07:00
dependabot[bot]
af95c788af
cargo: bump the cargo-dependencies group with 2 updates
...
Bumps the cargo-dependencies group with 2 updates: [serde](https://github.com/serde-rs/serde ) and [unicode-width](https://github.com/unicode-rs/unicode-width ).
Updates `serde` from 1.0.198 to 1.0.199
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.198...v1.0.199 )
Updates `unicode-width` from 0.1.11 to 0.1.12
- [Commits](https://github.com/unicode-rs/unicode-width/compare/v0.1.11...v0.1.12 )
---
updated-dependencies:
- dependency-name: serde
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: unicode-width
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 18:15:13 +02:00
Charles Crete
c8123e1555
docs: mention obslog in tutorial
2024-04-29 08:40:05 -07:00
Yuya Nishihara
6a208e7af7
doc: fix typo of contained_in() template method
2024-04-29 22:56:44 +09:00
Noah Mayr
dc693e7b8f
template: add contained_in method to commit object in templates
...
this allows to conditionally display or label elements depending on
whether the given commit is contained within the revset
2024-04-29 12:16:42 +02:00
Benjamin Tan
0e2e09a593
rebase: allow both --insert-after
and --insert-before
options to be used simultaneously
2024-04-29 14:19:09 +08:00
Benjamin Tan
f75461efc1
rebase: add --insert-after
and --insert-before
options for --revisions
2024-04-29 14:19:09 +08:00
Benjamin Tan
714bc0a9e6
rebase: add move_commits
function to perform rebasing
...
The `move_commits` function accepts a set of target commits to shift to
a new location given by `new_parents` and `new_children`. The roots of
the target set will be reparented onto `new_parents`. `new_children`
will then be reparented onto the heads of the target set.
The commits will be rebased in reverse topological order based on the
new set of parents of each commit, which avoids the need for multiple
sets of rebase operations.
2024-04-29 14:19:09 +08:00
Martin von Zweigbergk
492dd99ba5
squash: add test that immutable commits are respected for --from/--into
2024-04-28 13:06:37 -07:00
Martin von Zweigbergk
9503179ea4
tests: avoid a use of deprecated jj move
2024-04-28 11:12:51 -07:00
Benjamin Tan
6752402113
rebase: allow -r
to accept multiple revisions
2024-04-26 23:51:52 +08:00
dploch
586ab1f076
revset: add a SymbolResolverExtension trait to provide custom resolvers
2024-04-26 10:55:34 -04:00
dploch
0cef90f4f4
examples: simplify commit templater example with Default
2024-04-26 10:55:34 -04:00
dploch
bad9e9e3d7
revset: convert commit and change prefix resolvers into partial symbol resolvers
2024-04-26 10:55:34 -04:00
dploch
7bdf2b3945
revset: homogenize the logic of various symbol resolution steps into a common trait
2024-04-26 10:55:34 -04:00
dploch
cf78532bd8
revset: add two new error variants to support extensions
2024-04-26 10:55:34 -04:00
Martin von Zweigbergk
d13be927a8
cli: add global --ignore-immutable
...
Closes #3576
2024-04-26 06:13:15 -07:00
Yuya Nishihara
c267f55809
templates: remove implicit self dependency from description_placeholder alias
...
Spotted while experimenting with "jj tag list -T". The description_placeholder
alias could be changed to function taking a Commit object, but I feel it's odd.
Conceptually, the placeholder could also be used in "op log" templates.
2024-04-26 16:56:35 +09:00
Yuya Nishihara
dbc7ad2d8e
templates: extract common parts from commit_summary templates
...
If "branch"/"tag list" are migrate to templates, the added alias function
will be called from these templates.
2024-04-26 16:56:35 +09:00
Yuya Nishihara
2bd6983003
templates: reimplement builtin_change_id_with_hidden_and_divergent_info alias
...
This helps extract commit_summary template as an alias function.
2024-04-26 16:56:35 +09:00
Théo Daron
2f45a482a6
fixed usage of old "checkout" command in contributing docs
2024-04-25 09:11:52 -07:00
Yuya Nishihara
a63dbcc329
templater: include actual type name in error messages
2024-04-26 00:57:26 +09:00
Yuya Nishihara
5394f342ce
templater: add type_name() method to tagged property types
...
Suppose we add binary comparison operators, we'll probably need an easy way to
get (lhs, rhs) property types to produce a meaningful error message.
2024-04-26 00:57:26 +09:00
Yuya Nishihara
5b769c5c9e
fileset, revset, templater: add support for single-quoted raw string literals
...
Since fileset/revset/template expressions are specified as command-line
arguments, it's sometimes convenient to use single quotes instead of double
quotes. Various scripting languages parse single-quoted strings in various ways,
but I choose the TOML rule because it's simple and practically useful. TOML is
our config language, so copying the TOML syntax would be less surprising than
borrowing it from another language.
https://github.com/toml-lang/toml/issues/188
2024-04-25 11:14:33 +09:00
Yuya Nishihara
a74bf89df5
revset: reuse parse_symbol_rule_as_literal() to parse string symbol
...
For the same reason as the previous commit. Single-quoted string literal will
be handled there.
2024-04-25 11:14:33 +09:00
Yuya Nishihara
37bd966357
fileset: extract inner function that parses string-like literal
...
I'm going to add single-quoted string literal.
2024-04-25 11:14:33 +09:00
dependabot[bot]
ca02141ba9
github: bump actions/checkout in the github-dependencies group
...
Bumps the github-dependencies group with 1 update: [actions/checkout](https://github.com/actions/checkout ).
Updates `actions/checkout` from 4.1.3 to 4.1.4
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](1d96c772d1...0ad4b8fada
)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: github-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-04-24 13:23:17 -05:00
Martin von Zweigbergk
3dad9d4a98
docs: make "Arch Linux" a subheading under "Linux"
...
I think this is how it was supposed to be. The "From Source" section
applies to non-Arch Linuxes too.
2024-04-24 09:22:51 -07:00
Rowan Walsh
16ffe9408c
Fixes grammar issues in docs
2024-04-24 09:12:37 -07:00
Rowan Walsh
f185a838d7
Fixes typo in 'jj git init' args
2024-04-24 09:12:37 -07:00
Rowan Walsh
742c3f6fea
Fixes minor typo in script error message
2024-04-24 09:12:37 -07:00
Rowan Walsh
1490c0a196
Fixes typo in docs
2024-04-24 09:12:37 -07:00
dependabot[bot]
8069d5ef32
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.2 to 4.3.3
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](1746f4ab65...65462800fd
)
---
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-04-24 04:53:17 +00:00
Yuya Nishihara
528ccb318e
fileset: fall back to bare pattern/string if no operator-like character found
...
While I like strict parsing, it's not uncommon that we have to deal with file
names containing spaces, and doubly-quoted strings such as '"Foo Bar"' look
ugly. So, this patch adds an exception that accepts top-level bare strings.
This parsing rule is specific to command arguments, and won't be enabled when
loading fileset aliases.
2024-04-24 12:02:07 +09:00
dependabot[bot]
988ca2b23d
cargo: bump rustix in the cargo-dependencies group
...
Bumps the cargo-dependencies group with 1 update: [rustix](https://github.com/bytecodealliance/rustix ).
Updates `rustix` from 0.38.33 to 0.38.34
- [Release notes](https://github.com/bytecodealliance/rustix/releases )
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.33...v0.38.34 )
---
updated-dependencies:
- dependency-name: rustix
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-04-23 18:29:00 +02:00
dependabot[bot]
36e51a580d
github: bump EmbarkStudios/cargo-deny-action
...
Bumps the github-dependencies group with 1 update: [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action ).
Updates `EmbarkStudios/cargo-deny-action` from 1.6.2 to 1.6.3
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases )
- [Commits](b01e7a8cfb...3f4a782664
)
---
updated-dependencies:
- dependency-name: EmbarkStudios/cargo-deny-action
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: github-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 17:35:52 -05:00
dependabot[bot]
bb9d96c0c0
cargo: bump the cargo-dependencies group with 2 updates
...
Bumps the cargo-dependencies group with 2 updates: [rustix](https://github.com/bytecodealliance/rustix ) and [thiserror](https://github.com/dtolnay/thiserror ).
Updates `rustix` from 0.38.32 to 0.38.33
- [Release notes](https://github.com/bytecodealliance/rustix/releases )
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.32...v0.38.33 )
Updates `thiserror` from 1.0.58 to 1.0.59
- [Release notes](https://github.com/dtolnay/thiserror/releases )
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.58...1.0.59 )
---
updated-dependencies:
- dependency-name: rustix
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: thiserror
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 16:00:13 +00:00
Martin von Zweigbergk
9d7ed54f8e
git_backend: add a README to conflicted commits
...
When you use e.g. `git switch` to check out a conflicted commit,
you're going to end up with the `.jjconflicts-*` directories in your
working copy. It's probably not obvious what those mean. This patch
adds a README file to the root tree to try to explain to users what's
going on and how to recover.
The authoritative information about conflicts is stored in the
`jj:trees` commit header. The contents of conflicted commits is only
used for preventing GC. We can therefore add contents to the tree
without much consequence.
2024-04-22 06:22:54 -07:00
Benjamin Tan
e14ee8b563
rebase: do not simplify ancestor merges
2024-04-22 21:05:49 +08:00
Benjamin Tan
3ee35e70e9
rebase: modify tests to avoid a future ancestor merge with root commit
...
I will be updating `rebase -r` to avoid simplifying ancestor merges in a
subsequent commit, which will cause existing tests to fail for the Git
backend due to ancestor merges with the root commit.
2024-04-22 21:05:49 +08:00
Benjamin Tan
fb7c91ffa8
rebase: rewrite rebase_revision
to use transform_descendants
2024-04-22 21:05:49 +08:00