Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file deletion ignored by jj split #3702

Open
Zoybean opened this issue May 17, 2024 · 4 comments
Open

file deletion ignored by jj split #3702

Zoybean opened this issue May 17, 2024 · 4 comments

Comments

@Zoybean
Copy link

Zoybean commented May 17, 2024

Description

jj split and jj squash -i both appear to ignore selected file deletions. This appears to be limited to the default editor (could not reproduce with --tool meld). They are shown in the diff editor but do not end up in the chosen commit.

Steps to Reproduce the Problem

  1. mv foo bar
  2. jj split
  3. select all changes
  4. jj show @-
  5. jj show @

Expected Behavior

the first commit contains a file addition (bar) and a file deletion (foo)
the second commit is empty

Actual Behavior

the first commit contains a file addition (bar)
the second commit contains a file deletion (foo)

Specifications

  • Platform: Windows 10
  • Version: jj 0.17.1-c34f35fffe1b8e5932ba27ac4da8ba5a97d417a5
@hroi
Copy link

hroi commented May 20, 2024

I'm able to reproduce this with :builtin, but not when running scm-diff-editor as an external tool:

# config.toml
# Install scm-diff-editor binary:
# cargo install --git https://github.com/arxanas/scm-record.git --features scm-diff-editor

[ui]
# diff-editor = ":builtin"
diff-editor = "scm-diff-editor"

[merge-tools.scm-diff-editor]
program = "/path/to/scm-diff-editor"
edit-args = ["--dir-diff", "$left", "$right"]

@martinvonz
Copy link
Owner

That's good to know. That means the problem is probably somewhere in cli/src/merge_tools/builtin.rs, in case anyone has time to take a look.

@Zoybean
Copy link
Author

Zoybean commented May 20, 2024

the code at apply_diff_builtin's first match arm seems suspect to me, but I haven't got enough familiarity with the codebase to know for sure one way or the other.

@30350n
Copy link

30350n commented May 26, 2024

Possibly related to #3526.

I missunderstood that one and am actually experiencing the issue describe in here. I could imagine that they are related though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants