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

Use of scm-diff-editor will create an extra JJ-INSTRUCTIONS change in jj split #4984

Closed
ccll opened this issue Nov 27, 2024 · 6 comments
Closed
Labels
🐛bug Something isn't working scm-record Issues relating to the scm-record library, used as the default interactive diff/merge editor.

Comments

@ccll
Copy link

ccll commented Nov 27, 2024

Description

While the bug below has not been fixed, I'm trying to use the vanilla scm-diff-editor as said to work.

It works on deleted files when jj split, but has another issue: a dummy JJ-INSTRUCTIONS appears as a change.

Steps to Reproduce the Problem

  1. install scm-diff-editor
    cargo install scm-diff-editor

  2. set diff-editor to scm-diff-editor

[ui]
diff-editor = "scm-diff-editor"

[merge-tools.scm-diff-editor]
program = "scm-diff-editor"
edit-args = ["--dir-diff", "$left", "$right"]
  1. jj split

Expected Behavior

Just show the exact changes, nothing more, nothing less.

Actual Behavior

image

Specifications

  • Platform: Windows 11
  • Version: jj 0.23.0-5de285f5eb727b613434979cd9d83c30cabaffae
@PhilipMetzger PhilipMetzger added 🐛bug Something isn't working scm-record Issues relating to the scm-record library, used as the default interactive diff/merge editor. labels Nov 27, 2024
@arxanas
Copy link
Contributor

arxanas commented Nov 27, 2024

Does the file actually get committed? I had thought the file appears for all diff editors, and is ignored regardless of whether it gets selected.

@arxanas
Copy link
Contributor

arxanas commented Nov 27, 2024

Does the file actually get committed? I had thought the file appears for all diff editors, and is ignored regardless of whether it gets selected.

If it's true that selecting/unselecting JJ-INSTRUCTIONS doesn't affect the outcome, then we should probably add a note to JJ-INSTRUCTIONS itself that it doesn't matter what you do with it.

It's also interesting that JJ-INSTRUCTIONS doesn't appear for the built-in editor. I don't recall if that was intentional or not. It would be nice if scm-record were intuitive enough to not require instructions, but I think that's not the case at present 🤣.

I also opened arxanas/scm-record#78 to suggest adding a more-integrated way of providing help text with the built-in editor.

@ccll
Copy link
Author

ccll commented Nov 28, 2024

Does the file actually get committed? I had thought the file appears for all diff editors, and is ignored regardless of whether it gets selected.

Confirm that the JJ-INSTRUCTIONS file does NOT get committed, so it's just a little annoying rather than actual harmful.

@martinvonz
Copy link
Member

I think this is working as intended then. See https://martinvonz.github.io/jj/latest/config/#jj-instructions for how to disable the JJ-INSTRUCTIONS file. Feel free to reopen if you think there's something else we should do.

@arxanas
Copy link
Contributor

arxanas commented Nov 28, 2024

@martinvonz I think action items here would be

  • Update the instruction text to clarify that it won't be committed
  • Update the instruction text to specify how to disable it

@ccll Would those have helped you in this case? Perhaps you're interested in trying the above?

@ccll
Copy link
Author

ccll commented Jan 2, 2025

@ccll Would those have helped you in this case? Perhaps you're interested in trying the above?

I've disabled the file with @martinvonz 's suggestion.
However I think your action 2 might be a great idea for anyone that missed the document like me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working scm-record Issues relating to the scm-record library, used as the default interactive diff/merge editor.
Projects
None yet
Development

No branches or pull requests

4 participants