Skip to content

Conversation

@asibahi
Copy link

@asibahi asibahi commented Dec 6, 2025

hit this a few times unintentionally doing AoC, where the warning shown is hidden by the new editor opening, doing something like jj commit d5p1.

I have not done items in the checklist below because I am not sure if this is even the best approach.

Edit: On a personal level I'd rather the file set become the message in this case but that's probably not something jj wants to do.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes

@asibahi asibahi requested a review from a team as a code owner December 6, 2025 13:11
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

The following commits do not follow our format for subject lines:

  • 9f3916e: add error for committing an empty file set without a message

Commits should have a subject line following the format <topic>: <description>. Please review the commit guidelines for more information.

hit this a few times unintentionally doing AoC, where the warning shown is hidden by the new editor opening
@github-actions github-actions bot dismissed their stale review December 6, 2025 13:17

All commits are now correctly formatted. Thank you for your contribution!

@PhilipMetzger
Copy link
Contributor

related issue #4414

@yuja
Copy link
Contributor

yuja commented Dec 7, 2025

I think it's valid to create an empty revision with an empty description. It might be okay to show a warning or a hint, though.

@asibahi
Copy link
Author

asibahi commented Dec 7, 2025

I think it's valid to create an empty revision with an empty description. It might be okay to show a warning or a hint, though.

This still can be dome intentionally with -m "".

As is, the existing warning gets printed then immediately hidden by the editor window. Isaac mentioned on discord that the editor returning a non-0 exist code would abort the operation, (and it exists on vim and helix with :cq,) but that's not immediately obvious.

@yuja
Copy link
Contributor

yuja commented Dec 7, 2025

Since it's not wrong to create a commit with no description, -m '' shouldn't be required. That's the point. You can undo the commit if it was a mistake.

@asibahi
Copy link
Author

asibahi commented Dec 7, 2025

what is the point of the commit command if there is no message, tho? then it is just new.

note that this PR is only about the situation where an empty file set is provided (which already has a warning) and no message provided, which I think is more likely to be a mistake than not.

@yuja
Copy link
Contributor

yuja commented Dec 7, 2025

Yes, it's just new (plus an empty describe, which isn't an error either.) I prefer not adding special error condition which isn't actually invalid.

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.

3 participants