Name the file that has no conflict markers - #1041
Open
VXNCXNX wants to merge 3 commits into
Open
Conversation
When difftastic is given a single file, the error message did not say which file was inspected or why it was rejected. Name the file and state that it contains no conflict markers. Closes Wilfred#764 Written with AI assistance (Claude Code); I have read the change and am accountable for it.
The options were listed in declaration order, which is essentially arbitrary. Ask clap to sort them alphabetically instead. Closes Wilfred#830 Written with AI assistance (Claude Code); I have read the change and am accountable for it.
Owner
|
These are unrelated, could you split the PRs? |
Contributor
Author
|
Split done. This one is now just the error message change, and the --help sorting moved to #1043. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #764 and #830. Two small commits, one each.
Disclosure per AI_POLICY.md: written with AI assistance (Claude Code). I have read every line of both changes and am accountable for them; happy to discuss any part.
#764 — error message on a single file
Before, any single-file invocation gave the same generic message, whether the file had markers or not:
After:
You asked that it "explicitly mention that foo.ts had no conflict markers", so the file is named and the reason stated; the USAGE block below is unchanged.
I checked that this message can't lie about a different failure: a nonexistent path, a directory, and a binary file all exit earlier with their own messages (
No such file,Expected a file, got a directory,Expected a text file with conflict markers, got a binary file). Only a text file with zero conflicts reaches this branch. An empty file correctly reports having no markers.#830 — sort options in
--help.next_display_order(None), so clap sorts alphabetically:Sorting is within groups, so
DEBUG OPTIONSremains a separate heading, still last, with its three entries. This affects--helponly — no shell completions are committed, andmanual/difft.1.mdis hand-maintained and already alphabetical, so this actually brings--helpinto agreement with the man page rather than making anything stale. I didn't runjust man, since nothing there changed.Gates
Total diff is 5 insertions, 1 deletion across the two commits.