Skip to main content

Module rule_commit_only_message

Module rule_commit_only_message 

Source
Expand description

User-facing diagnostics of the commit-only transform. What: The user-facing diagnostics of the commit-only transform. Why: Each message names the rejected form and every valid way forward; keeping the text apart from the decision keeps both files readable.

In TS you’d write (pseudocode):

// const NO_PATHSPEC_MESSAGE = 'cli-git: git commit requires an explicit pathspec ...';

Constants§

ALL_FLAG_MESSAGE
Diagnostic for -a/--all, which stages tracked modifications implicitly.
NO_PATHSPEC_MESSAGE
Diagnostic for a commit with no pathspec source and no mode that permits a pathless only-commit.

Functions§

ignored_index_message
What: Build the diagnostic for a pathless --amend/--allow-empty commit over a dirty index. &str borrows the flag text; String is the owned result. Why: An injected --only would commit HEAD’s existing tree and leave the staged changes staged without any warning from Git.