# Simple home directory versioning
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.
## Installation
```shell
pip install baldwin
```
## Usage
```plain
$ bw -h
Usage: bw [OPTIONS] COMMAND [ARGS]...
Manage a home directory with Git.
Options:
-d, --debug Enable debug logging.
-h, --help Show this message and exit.
Commands:
auto-commit
format
git
info
init
install-units
```
In addition to the `bw` command, `hgit` is a shortcut for `bw git`.
### Start a new repository
```shell
bw init
```
Find out where the bare Git directory is by running `bw info`. This can be done even if `init` has
not been run.
### Automation
#### systemd
```shell
bw install-units
```
This will install a timer that will automatically make a new commit every 6 hours. It does not push.
Keep in mind that systemd units require a full path to the executable, so you must keep the unit
up-to-date if you move where you install this package. Simply run `bw install-units` again.
Note that user systemd units only run while logged in.
To disable and remove the units, use the following commands:
```shell
systemctl disable --now home-vcs.timer
rm ~/.config/systemd/user/home-vcs.*
```
### Pushing
To push, use either of the following:
- `bw git push`
- `hgit push`
The above also demonstrates that `bw git`/`hgit` are just frontends to `git` with the correct
environment applied.
## Formatting
If Prettier is installed, it will be used to format files. The configuration used comes with this
package. Having consistent formatting allows for nice diffs to be generated.
If you have initialised a repository without having `prettier` or `jq` in `PATH`, you need to run the
following commands to enable readable diffs:
```shell
hgit config diff.json.textconv 'jq -MS .'
hgit config diff.json.cachetextconv true
hgit config diff.yaml.textconv 'prettier --no-editorconfig --parser yaml'
hgit config diff.yaml.cachetextconv true
```
If you have the XML plugin installed:
```shell
hgit config diff.xml.textconv 'prettier --no-editorconfig --parser xml --xml-whitespace-sensitivity ignore'
hgit config diff.xml.cachetextconv true
```
## Binary files
Any file that is untracked and detected to be binary will not be added. Use `hgit add` to add a
binary file manually.
## Other details
Default `.gitignore` and `.gitattributes` files are installed on initialisation. They are never
modified by this tool. Please customise as necessary.
Raw data
{
"_id": null,
"home_page": "https://github.com/Tatsh/baldwin",
"name": "baldwin",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.12",
"maintainer_email": null,
"keywords": "command line, file management, git, version control",
"author": "Andrew Udvare",
"author_email": "audvare@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/6e/06/2d255a7ec9a73abd2d994e6c5b807c2f4288aa3bab3051583c16b4170a7d/baldwin-0.0.4.tar.gz",
"platform": null,
"description": "# Simple home directory versioning\n\nThis is a conversion of my simple scripts to version my home directory with very specific excludes\nand formatting every file upon commit so that readable diffs can be generated.\n\n## Installation\n\n```shell\npip install baldwin\n```\n\n## Usage\n\n```plain\n $ bw -h\nUsage: bw [OPTIONS] COMMAND [ARGS]...\n\n Manage a home directory with Git.\n\nOptions:\n -d, --debug Enable debug logging.\n -h, --help Show this message and exit.\n\nCommands:\n auto-commit\n format\n git\n info\n init\n install-units\n```\n\nIn addition to the `bw` command, `hgit` is a shortcut for `bw git`.\n\n### Start a new repository\n\n```shell\nbw init\n```\n\nFind out where the bare Git directory is by running `bw info`. This can be done even if `init` has\nnot been run.\n\n### Automation\n\n#### systemd\n\n```shell\nbw install-units\n```\n\nThis will install a timer that will automatically make a new commit every 6 hours. It does not push.\n\nKeep in mind that systemd units require a full path to the executable, so you must keep the unit\nup-to-date if you move where you install this package. Simply run `bw install-units` again.\n\nNote that user systemd units only run while logged in.\n\nTo disable and remove the units, use the following commands:\n\n```shell\nsystemctl disable --now home-vcs.timer\nrm ~/.config/systemd/user/home-vcs.*\n```\n\n### Pushing\n\nTo push, use either of the following:\n\n- `bw git push`\n- `hgit push`\n\nThe above also demonstrates that `bw git`/`hgit` are just frontends to `git` with the correct\nenvironment applied.\n\n## Formatting\n\nIf Prettier is installed, it will be used to format files. The configuration used comes with this\npackage. Having consistent formatting allows for nice diffs to be generated.\n\nIf you have initialised a repository without having `prettier` or `jq` in `PATH`, you need to run the\nfollowing commands to enable readable diffs:\n\n```shell\nhgit config diff.json.textconv 'jq -MS .'\nhgit config diff.json.cachetextconv true\nhgit config diff.yaml.textconv 'prettier --no-editorconfig --parser yaml'\nhgit config diff.yaml.cachetextconv true\n```\n\nIf you have the XML plugin installed:\n\n```shell\nhgit config diff.xml.textconv 'prettier --no-editorconfig --parser xml --xml-whitespace-sensitivity ignore'\nhgit config diff.xml.cachetextconv true\n```\n\n## Binary files\n\nAny file that is untracked and detected to be binary will not be added. Use `hgit add` to add a\nbinary file manually.\n\n## Other details\n\nDefault `.gitignore` and `.gitattributes` files are installed on initialisation. They are never\nmodified by this tool. Please customise as necessary.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple tracking of your home directory with easy-to-read diffs.",
"version": "0.0.4",
"project_urls": {
"Documentation": "https://baldwin.readthedocs.org",
"Homepage": "https://github.com/Tatsh/baldwin",
"Issues": "https://github.com/Tatsh/baldwin/issues",
"Repository": "https://github.com/Tatsh/baldwin"
},
"split_keywords": [
"command line",
" file management",
" git",
" version control"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "df5ce693236030f1099e4691b00345f7d875369d53e8fd2f96a5e2f2f3f2b941",
"md5": "cb311365875784c46714a82c08279186",
"sha256": "f5646fa9fbb2b36de75e121c5188a5559bd7773d89292dcb79b9547d217dfea5"
},
"downloads": -1,
"filename": "baldwin-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cb311365875784c46714a82c08279186",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.12",
"size": 8250,
"upload_time": "2024-11-29T03:07:20",
"upload_time_iso_8601": "2024-11-29T03:07:20.583136Z",
"url": "https://files.pythonhosted.org/packages/df/5c/e693236030f1099e4691b00345f7d875369d53e8fd2f96a5e2f2f3f2b941/baldwin-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6e062d255a7ec9a73abd2d994e6c5b807c2f4288aa3bab3051583c16b4170a7d",
"md5": "75a58ca978600d04951fa5686c50f309",
"sha256": "dc8d150e5a23377629877e11fcd9798a04688ba31f29db29dd797b9d8f1562cb"
},
"downloads": -1,
"filename": "baldwin-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "75a58ca978600d04951fa5686c50f309",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.12",
"size": 9301,
"upload_time": "2024-11-29T03:07:21",
"upload_time_iso_8601": "2024-11-29T03:07:21.478939Z",
"url": "https://files.pythonhosted.org/packages/6e/06/2d255a7ec9a73abd2d994e6c5b807c2f4288aa3bab3051583c16b4170a7d/baldwin-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-29 03:07:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Tatsh",
"github_project": "baldwin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "baldwin"
}