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 deletes don't squash with --interactive #4943

Closed
charlottia opened this issue Nov 22, 2024 · 3 comments
Closed

File deletes don't squash with --interactive #4943

charlottia opened this issue Nov 22, 2024 · 3 comments

Comments

@charlottia
Copy link

Description

If you interactively squash changes, and only squash a complete file deletion, "Error: No changes selected" tells you something's amiss.

If you squash a file deletion and a few other things, the file deletion doesn't get squashed and remains a part of the working-copy commit. The other changes do squash.

I haven't checked if this only happens with the builtin diff editor (what I've been using here) and thus is likely to be a bug with that, or if it's part of squash itself yet.

Am happy to look into this and possibly prepare a fix unless this is known/obvious/known to be hairy/etc.! Let me know. :)

Steps to Reproduce the Problem

$ mkdir testcase
$ cd testcase
$ jj git init
Initialized repo in "."
$ echo hello > hello
$ jj status --no-pager
Working copy changes:
A hello
Working copy : nnorpssx c13cdf5d (no description set)
Parent commit: zzzzzzzz 00000000 (empty) (no description set)
$ jj new
Working copy now at: pmkpkuon 77400499 (empty) (no description set)
Parent commit      : nnorpssx c13cdf5d (no description set)
$ echo bye > bye
$ rm hello
$ jj status --no-pager
Working copy changes:
A bye
D hello
Working copy : pmkpkuon 62f836a9 (no description set)
Parent commit: nnorpssx c13cdf5d (no description set)
$ jj squash -i
image
Rebased 1 descendant commits
Working copy now at: pmkpkuon 4ec22139 (no description set)
Parent commit      : nnorpssx 3afc1cda (no description set)
$ jj status --no-pager
Working copy changes:
D hello
Working copy : pmkpkuon 4ec22139 (no description set)
Parent commit: nnorpssx 3afc1cda (no description set)
$ jj squash -i
image
Error: No changes selected
$ jj status --no-pager
Working copy changes:
D hello
Working copy : pmkpkuon 4ec22139 (no description set)
Parent commit: nnorpssx 3afc1cda (no description set)
$

Expected Behavior

File deletes are squashed into the target revision.

Actual Behavior

File deletes aren't squashed into the target revision, and remain a part of the working-copy commit.

Specifications

  • Platform: macOS (arm64)
  • Version: jj main c6bb019 (5h ago) with bnjmnt4n's ssh-openssh pair of commits rebased on top. I was previously on an older version but rebased to ensure this was still present.
@charlottia
Copy link
Author

On further inspection, I get the same trying to split the delete into its own change, so more likely to be a diff editor issue!

@ilyagr
Copy link
Contributor

ilyagr commented Nov 22, 2024

This is probably a duplicate of #3702.

@charlottia
Copy link
Author

Gah, how did I miss that! Thanks — closing as dupe.

@charlottia charlottia closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2024
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

2 participants