Baldwin¶
This is a conversion of my simple scripts to version my home directory with very specific excludes and formatting every file upon commit so that readable diffs can be generated.
Commands¶
bw¶
Manage a home directory with Git.
Usage
bw [OPTIONS] COMMAND [ARGS]...
auto-commit¶
Automated commit of changed and untracked files.
Usage
bw auto-commit [OPTIONS]
Options
- -d, --debug¶
Enable debug logging.
format¶
Format changed and untracked files.
Usage
bw format [OPTIONS]
Options
- -d, --debug¶
Enable debug logging.
git¶
Wrap git with git-dir and work-tree passed.
Usage
bw git [OPTIONS] [ARGS]...
Options
- -d, --debug¶
Enable debug logging.
Arguments
- ARGS¶
Optional argument(s)
info¶
Get basic information about the repository.
Usage
bw info [OPTIONS]
Options
- -d, --debug¶
Enable debug logging.
init¶
Start tracking a home directory.
Usage
bw init [OPTIONS]
Options
- -d, --debug¶
Enable debug logging.
install-units¶
Install systemd units for automatic committing.
Usage
bw install-units [OPTIONS]
Options
- -d, --debug¶
Enable debug logging.
hgit¶
Wrap git with git-dir and work-tree passed.
Usage
hgit [OPTIONS] [ARGS]...
Options
- -d, --debug¶
Enable debug logging.
Arguments
- ARGS¶
Optional argument(s)
Library¶
baldwin module.
Baldwin library.
- class baldwin.lib.RepoInfo(git_dir_path: Path, work_tree_path: Path)¶
General repository information.
-
async baldwin.lib.format_(filenames: Iterable[Path | str] | None =
None, log_level: 'silent' | 'error' | 'warn' | 'log' | 'debug' ='error') None¶ Format untracked and modified files in the repository.
Does nothing if Prettier is not in
PATH. Each file is formatted by a separate Prettier process; invocations run concurrently, bounded by the number of available CPUs.The following plugins will be detected and enabled if found:
@prettier/plugin-xml
prettier-plugin-ini
prettier-plugin-sort-json
prettier-plugin-toml
- baldwin.lib.get_config() BaldwinConfigContainer¶
Get the configuration (TOML file).
- baldwin.lib.get_git_path() Path¶
Get the Git directory (
GIT_DIR).This path is platform-specific. On Windows, the Roaming AppData directory will be used.
- baldwin.lib.init() None¶
Start tracking a home directory.
Does nothing if the Git directory already exists.
- baldwin.lib.install_units() None¶
Install systemd units for automatic committing.
- Raises:¶
FileNotFoundError – If the
bwexecutable is not found inPATH.
Typing helpers.
- class baldwin.typing.BaldwinConfigContainer¶
Container for Baldwin configuration.