diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..821e685 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Reduce merge conflicts for auto-generated TODO.md file +# The 'union' merge strategy combines lines from both versions without creating conflicts +# Since TODO.md is regenerated by the pre-commit hook after each commit, +# this prevents unnecessary merge conflicts during rebases +TODO.md merge=union diff --git a/README.md b/README.md index 690ef63..70fc004 100644 --- a/README.md +++ b/README.md @@ -263,11 +263,23 @@ Prebuilt wheels are published for: ## 🛠 Troubleshooting +### Build Issues + - If no wheel is available for your platform, `pip` will try to build from source — which **requires a Rust toolchain**. - If you encounter build errors, please: 1. Check the [latest releases](https://github.com/simone-viozzi/rusty-todo-md/releases) to confirm wheel availability. 2. Open an [issue](https://github.com/simone-viozzi/rusty-todo-md/issues) with your OS/arch details. +### Reducing Merge Conflicts + +When rebasing branches, the `TODO.md` file can create merge conflicts for each commit because line numbers change as code moves. To minimize these conflicts, add a `.gitattributes` file to your repository with the following content: + +```gitattributes +TODO.md merge=union +``` + +This tells Git to use the "union" merge strategy for `TODO.md`, which combines lines from both versions instead of creating conflicts. Since `TODO.md` is regenerated by the pre-commit hook after each commit, this approach safely prevents unnecessary merge conflicts during rebases. + --- ## 👩‍💻 Development