Skip to main content

Module setup

Module setup 

Source
Expand description

amont setup — choose what commit-msg enforces, once.

The keys in crate::commit_style are the answer to “these defaults do not suit me”. This is the answer to “I did not know there were any”. An adoption feature is only half built if the dial exists and nobody finds it, so the same four settings are offered here, each with its current value as the default and one line saying what it is for.

Input is stdin, not /dev/tty. trust::confirm opens /dev/tty because it prompts from inside a hook, where git owns stdin and reading it would consume a pre-push ref list. That reasoning does not reach here: this is a subcommand somebody typed, and its stdin IS the terminal. The general rule, worth stating once: /dev/tty for a prompt inside a hook, stdin for a prompt inside a subcommand. Reading stdin also works on Windows — where confirm is hard-coded to decline — and can be driven by a heredoc, which is how this is tested without a pty.

Nothing is written until every question has been answered, and what does get written is printed as the git config commands that would produce it. A wizard that reports “saved” has told you nothing you can check, paste into your dotfiles, or hand to a teammate.

Enums§

Where
Where the answers are written.

Functions§

command