# RejX
Deal with `.rej` files with reasonable pain
The application is designed to work with .rej files generated during patch application failures or from updating git templates using tools s.a. `cookiecutter` or `cruft`
It provides functionality to either fix these files individually or in bulk, view differences, list them, and clean them up.
The rich library is used for better console output formatting, providing a more user-friendly and visually appealing interface.
It's important to use the commands cautiously, especially fix_all and clean, as they perform bulk operations.
This documentation provides a clear guide on how to interact with the rejx Typer application, making it easier for users to understand and utilize its functionalities.
<img width="825" alt="Screenshot 2024-10-12 at 10 08 31" src="https://github.com/user-attachments/assets/25ff2011-74f4-494a-9199-b3fac219185b">
## Installation
```shell
# Pip
pip install rejx
# Poetry
poetry add rejx
```
## Usage
Your Python Typer application, rejx, provides a command line interface (CLI) for managing .rej files, which are typically generated when patches fail to apply cleanly. Below, I'll detail each command, its purpose, and how to use it, including optional arguments.
Most rejx commands support the flags:
- `--all` - Recursively apply the command in subfolders
- `--preview` - Preview what a command would do before applying
- `--show-hidden` - Include hidden files (`.file`) when applying the command
- `--exclude-hidden` - Exclude hidden files from command
For more details, rejx provides help for each commands
```sh
rejx --help
rejx <command> --help
```
### `fix`
Applies the changes from one or more specified `.rej` file to their corresponding original file.
`rejx fix path/to/file1.rej path/to/file2.rej ...`
Passing the optional flag `--all` applies the changes from all .rej files to their corresponding original files.
`rejx fix --all`
### `diff`
Displays the differences between the current file(s) and the changes proposed in the corresponding .rej file(s).
`rejx diff <filename1> <filename2> ...`
If no file name is passed, this displays the difference for all .rej files.
[!NOTE] This command uses a pager for output. Use arrow keys or Vim bindings to navigate, and q to quit.
### `ls`
Lists all .rej files in the current directory and subdirectories. By default, it lists files, but can also display them in a tree structure.
For listing files:
`rejx ls .`
The ls command supports different view modes.
Default view is a list of files, but there's also a tree view mode
For tree view:
`rejx ls . --view tree`
`rejx tree .`
### `clean`
Deletes specified .rej files. It has an optional preview feature.
The preview flag makes it possible to _preview_ which files would be staged for deletion before
applying it.
`rejx clean path/to/file1.rej path/to/file2.rej ...`
With preview:
`rejx clean path/to/file1.rej path/to/file2.rej ... --preview`
By passing the optional `--all` flag, this command deletes all the .rej files in the current directory and subdirectories.
`rejx clean . --all`
This can be combined with the `--preview` option.
`rejx clean . --all --preview`
## Shell Completion
To install shell completion for rejx commands
```sh
rejx --install-completion && exec $SHELL
```
______________________________________________________________________
## Dev
For developers looking to apply changes or contribute changes, install the project with the just
command
This will install the project, pre-commit and the dev dependencies
```sh
just setup
```
Raw data
{
"_id": null,
"home_page": "https://github.com/markussagen/rejx",
"name": "rejx",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "git, cookiecutter, cruft, rej",
"author": "Markus Sagen",
"author_email": "Markus.John.Sagen@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/08/c0/7c9037e1cb9203759e642d56706729fa37c0ffd4cddbac878eee7994ac61/rejx-0.2.0.tar.gz",
"platform": null,
"description": "# RejX\n\nDeal with `.rej` files with reasonable pain\n\nThe application is designed to work with .rej files generated during patch application failures or from updating git templates using tools s.a. `cookiecutter` or `cruft`\n\nIt provides functionality to either fix these files individually or in bulk, view differences, list them, and clean them up.\n\nThe rich library is used for better console output formatting, providing a more user-friendly and visually appealing interface.\n\nIt's important to use the commands cautiously, especially fix_all and clean, as they perform bulk operations.\n\nThis documentation provides a clear guide on how to interact with the rejx Typer application, making it easier for users to understand and utilize its functionalities.\n\n<img width=\"825\" alt=\"Screenshot 2024-10-12 at 10 08 31\" src=\"https://github.com/user-attachments/assets/25ff2011-74f4-494a-9199-b3fac219185b\">\n\n## Installation\n\n```shell\n# Pip\npip install rejx\n\n# Poetry\npoetry add rejx\n```\n\n## Usage\n\nYour Python Typer application, rejx, provides a command line interface (CLI) for managing .rej files, which are typically generated when patches fail to apply cleanly. Below, I'll detail each command, its purpose, and how to use it, including optional arguments.\n\nMost rejx commands support the flags:\n\n- `--all` - Recursively apply the command in subfolders\n- `--preview` - Preview what a command would do before applying\n- `--show-hidden` - Include hidden files (`.file`) when applying the command\n- `--exclude-hidden` - Exclude hidden files from command\n\nFor more details, rejx provides help for each commands\n\n```sh\nrejx --help\nrejx <command> --help\n```\n\n### `fix`\n\nApplies the changes from one or more specified `.rej` file to their corresponding original file.\n\n`rejx fix path/to/file1.rej path/to/file2.rej ...`\n\nPassing the optional flag `--all` applies the changes from all .rej files to their corresponding original files.\n\n`rejx fix --all`\n\n### `diff`\n\nDisplays the differences between the current file(s) and the changes proposed in the corresponding .rej file(s).\n\n`rejx diff <filename1> <filename2> ...`\n\nIf no file name is passed, this displays the difference for all .rej files.\n\n[!NOTE] This command uses a pager for output. Use arrow keys or Vim bindings to navigate, and q to quit.\n\n### `ls`\n\nLists all .rej files in the current directory and subdirectories. By default, it lists files, but can also display them in a tree structure.\nFor listing files:\n\n`rejx ls .`\n\nThe ls command supports different view modes.\nDefault view is a list of files, but there's also a tree view mode\n\nFor tree view:\n\n`rejx ls . --view tree`\n`rejx tree .`\n\n### `clean`\n\nDeletes specified .rej files. It has an optional preview feature.\nThe preview flag makes it possible to _preview_ which files would be staged for deletion before\napplying it.\n\n`rejx clean path/to/file1.rej path/to/file2.rej ...`\n\nWith preview:\n\n`rejx clean path/to/file1.rej path/to/file2.rej ... --preview`\n\nBy passing the optional `--all` flag, this command deletes all the .rej files in the current directory and subdirectories.\n\n`rejx clean . --all`\n\nThis can be combined with the `--preview` option.\n\n`rejx clean . --all --preview`\n\n## Shell Completion\n\nTo install shell completion for rejx commands\n\n```sh\nrejx --install-completion && exec $SHELL\n```\n\n______________________________________________________________________\n\n## Dev\n\nFor developers looking to apply changes or contribute changes, install the project with the just\ncommand\n\nThis will install the project, pre-commit and the dev dependencies\n\n```sh\njust setup\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Rej(spe)X - Deal with .rej file with minimal pain",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/markussagen/rejx",
"Repository": "https://github.com/markussagen/rejx"
},
"split_keywords": [
"git",
" cookiecutter",
" cruft",
" rej"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2b8e93d806bff2f5d8cb99697ac1ff572d3be5aaa043dbccc0feddea470fe9d5",
"md5": "7bf6cff67c9351f188d32e7f09fd38a6",
"sha256": "656641cd97c4c432397f3337650e0394c75f28fa014538afabda58cd599dbc75"
},
"downloads": -1,
"filename": "rejx-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7bf6cff67c9351f188d32e7f09fd38a6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 11073,
"upload_time": "2024-10-12T08:33:13",
"upload_time_iso_8601": "2024-10-12T08:33:13.051644Z",
"url": "https://files.pythonhosted.org/packages/2b/8e/93d806bff2f5d8cb99697ac1ff572d3be5aaa043dbccc0feddea470fe9d5/rejx-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "08c07c9037e1cb9203759e642d56706729fa37c0ffd4cddbac878eee7994ac61",
"md5": "b21cfeb4c53efc24cf9eeef0030963f3",
"sha256": "bfa5b587d7dbade41938b9396d347700b43dcd7656fb02be936923f8cb3c4f8e"
},
"downloads": -1,
"filename": "rejx-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b21cfeb4c53efc24cf9eeef0030963f3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 11808,
"upload_time": "2024-10-12T08:33:14",
"upload_time_iso_8601": "2024-10-12T08:33:14.642962Z",
"url": "https://files.pythonhosted.org/packages/08/c0/7c9037e1cb9203759e642d56706729fa37c0ffd4cddbac878eee7994ac61/rejx-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-12 08:33:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "markussagen",
"github_project": "rejx",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rejx"
}