Skip to content

fix for preview copied status file and filename with {} #357

Merged
idursun merged 3 commits intoidursun:mainfrom
baggiiiie:yc/test-s
Oct 27, 2025
Merged

fix for preview copied status file and filename with {} #357
idursun merged 3 commits intoidursun:mainfrom
baggiiiie:yc/test-s

Conversation

@baggiiiie
Copy link
Copy Markdown
Collaborator

@baggiiiie baggiiiie commented Oct 27, 2025

summary

Fix preview for files with C copied status and detail view with filenames with {}

for C copied file preview, see #355.

cause

C copied status file preview:

  • when the status for the file is C, jjui runs command similar to jj diff --color always -r kq 'file:"{new_file.md => copied_file.md}"'
  • it doesn't parse the filename correctly as C status isn't registered
  • which causes jj to fail with Warning: No matching entries for paths: {new_file.md => copied_file.md}

filename with {}:

  • as filenames with status like C(copied) and R(renamed) contain {}, and here uses strings.Contains and strings.Index to match {}, it causes panic and index out of bound error when filename contains {}
  • see reproduction of this bug: https://asciinema.org/a/4BiXzIguS86T9WLLLmliezYlw

fix

  • added C status and relevant changes
  • updated to use regex for filename matching
  • added tests for filenames with {}
  • added tests for directory level file operation (details see screenshots below):
R {src/new_file_3.md => new_file.md}  # moving out of directory src
R src/{new_file.py => renamed_py.py} # moving within directory src
R {src1/to_be_renamed.md => src2/renamed.md}  # moving from dir src1 to src2
  • changed to iota enum for file status

after fix

what jj shows:
image
what jjui shows:
image

@baggiiiie
Copy link
Copy Markdown
Collaborator Author

hey @idursun

just saw your comments about how to recreate the bug in #355, this is what i have:

echo "copy1\ncopy2\ncopy3\n" > copy-source 

jj new 

# modify the source slightly and create a copy with similar content 
echo "copy1\ncopy2\ncopy3\nsource\n" > copy-source 
echo "copy1\ncopy2\ncopy3\ntarget\n" > copy-target

jj status
# show `C` prefix

jjui
# doesn't show `C`

Copy link
Copy Markdown
Owner

@idursun idursun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks! Very nice work 🫶

@idursun idursun merged commit 360d612 into idursun:main Oct 27, 2025
3 checks passed
@idursun
Copy link
Copy Markdown
Owner

idursun commented Oct 27, 2025

@baggiiiie FYI, you can add "fixes #issuenumber" in your PR description so that the issue is automatically closed when PR is merged.

@baggiiiie
Copy link
Copy Markdown
Collaborator Author

Very nice work 🫶

@idursun hey thank you for the encouraging words! love to contribute when i could!

and thanks for letting me know about fixes, i wasn't aware of that at all
hilariously i've been using see #issuenumber, so close to use the magic keyword by accident lol

@baggiiiie baggiiiie deleted the yc/test-s branch October 28, 2025 01:35
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 24, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [idursun/jjui](https://github.com/idursun/jjui) | patch | `v0.9.5` -> `v0.9.6` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>idursun/jjui (idursun/jjui)</summary>

### [`v0.9.6`](https://github.com/idursun/jjui/releases/tag/v0.9.6)

[Compare Source](idursun/jjui@v0.9.5...v0.9.6)

Another community driven release, mostly focusing on every day improvements.

#### What's Changed

- fix(ace\_jump): close operation after applying jump by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;351](idursun/jjui#351)
- feat: auto-detect preview placement, on by default by [@&#8203;lbonn](https://github.com/lbonn) in [#&#8203;348](idursun/jjui#348)
- feat: allow remote selection in git menu by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;349](idursun/jjui#349)
- fix(fuzzy\_files): quote path for editor command by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;354](idursun/jjui#354)
- fix for preview copied status file and filename with {}  by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;357](idursun/jjui#357)
- Support interactive file-level restores by [@&#8203;remo5000](https://github.com/remo5000) in [#&#8203;365](idursun/jjui#365)
- fuzzy\_files: remove quoting for files in revset by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;370](idursun/jjui#370)
- ui/git: add --tracked to git fetch by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;368](idursun/jjui#368)
- operation: add ForceApply to squash/rebase footer by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;371](idursun/jjui#371)
- abandon: add force apply to footer help menu by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;373](idursun/jjui#373)
- docs(README): add winget and scoop as installation method in Windows by [@&#8203;abgox](https://github.com/abgox) in [#&#8203;362](idursun/jjui#362)
- fix(set\_parents): keep parent order by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;375](idursun/jjui#375)
- fix(light theme): Removed the default border style of `bright white` as it was overriding the `text` style which should be the terminal’s default foreground and background.

#### New Contributors

- [@&#8203;lbonn](https://github.com/lbonn) made their first contribution in [#&#8203;348](idursun/jjui#348)
- [@&#8203;remo5000](https://github.com/remo5000) made their first contribution in [#&#8203;365](idursun/jjui#365)
- [@&#8203;abgox](https://github.com/abgox) made their first contribution in [#&#8203;362](idursun/jjui#362)

**Full Changelog**: <idursun/jjui@v0.9.5...v0.9.6>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS4wIiwidXBkYXRlZEluVmVyIjoiNDIuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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

Successfully merging this pull request may close these issues.

2 participants