|
| 1 | +# Version Control with Jujutsu |
| 2 | + |
| 3 | +Guidelines for using Jujutsu (jj) for version control operations in this dotfiles project. |
| 4 | + |
| 5 | +## Core Principles |
| 6 | + |
| 7 | +- Use `jj` for version control operations. Background LLM Agent must not use `git`. |
| 8 | +- **Pre-Commit Validation**: Run `make validate` and ensure it passes before any commit |
| 9 | +- **User Confirmation**: Always obtain explicit user confirmation before executing any commit commands to VCS (use only `jj`). |
| 10 | +- Follow conventional commit message format |
| 11 | +- Use atomic commits with `jj commit` |
| 12 | +- Sign commits when possible (using GPG or SSH signing) |
| 13 | + |
| 14 | +## Version Control Basics |
| 15 | + |
| 16 | +- **ALWAYS use `jj` (Jujutsu) for version control - NEVER use `git` commands** |
| 17 | +- Make atomic commits with `jj commit` |
| 18 | +- Follow [Conventional Commits](https://www.conventionalcommits.org/) format: |
| 19 | + - `feat:` for new features |
| 20 | + - `fix:` for bug fixes |
| 21 | + - `refactor:` for code refactoring |
| 22 | + - `test:` for adding or updating tests |
| 23 | + - `docs:` for documentation changes |
| 24 | + - `chore:` for maintenance tasks |
| 25 | + |
| 26 | +## Committing Changes |
| 27 | + |
| 28 | +**Minimize command overhead when committing:** |
| 29 | + |
| 30 | +**ONLY use these two commands when committing:** |
| 31 | +1. **Review changes**: Run `jj show` to see current changes |
| 32 | +2. **Commit atomically**: Run `jj commit -m "message"` to commit |
| 33 | + |
| 34 | +**Do NOT run:** |
| 35 | +- `jj status` (not needed before committing) |
| 36 | +- `jj diff` (use `jj show` instead) |
| 37 | +- `jj log` (not needed after committing) |
| 38 | +- Any other verification commands unless `jj commit` returns an error |
| 39 | + |
| 40 | +**Example workflow:** |
| 41 | +```bash |
| 42 | +# Review what changed |
| 43 | +jj show |
| 44 | + |
| 45 | +# Commit with descriptive message |
| 46 | +jj commit -m "fix: initialize database on launch to handle empty state" |
| 47 | + |
| 48 | +# That's it! No need for jj status, jj diff, jj log, or other verification commands |
| 49 | +``` |
| 50 | + |
| 51 | +**Important:** |
| 52 | +- `jj commit` is atomic and will report errors if it fails |
| 53 | +- Trust the command - if it succeeds, the commit is complete |
| 54 | +- Only investigate further if you see an error message |
| 55 | +- `jj status` and `jj diff` are fine for exploration/debugging, but not needed as part of the commit workflow |
| 56 | + |
| 57 | +## Jujutsu Workflow Integration |
| 58 | + |
| 59 | +### Commit Message Format |
| 60 | +``` |
| 61 | +<type>(<scope>): <description> |
| 62 | +
|
| 63 | +[optional body] |
| 64 | +
|
| 65 | +[optional footer] |
| 66 | +``` |
| 67 | + |
| 68 | +#### Types |
| 69 | +- `feat`: new feature |
| 70 | +- `fix`: bug fix |
| 71 | +- `docs`: documentation changes |
| 72 | +- `style`: formatting changes |
| 73 | +- `refactor`: code refactoring |
| 74 | +- `test`: adding tests |
| 75 | +- `chore`: maintenance tasks |
| 76 | +- `ci`: automation tasks |
| 77 | +- `ai`: modifications to llm configuration |
| 78 | + |
| 79 | +#### Examples |
| 80 | +``` |
| 81 | +feat(bash): add rust development tools installer |
| 82 | +
|
| 83 | +Implement comprehensive installer for modern Rust-based CLI tools including |
| 84 | +error handling, progress feedback, and dependency checking. |
| 85 | +
|
| 86 | +feat(jj): enhance log aliases with better filtering |
| 87 | +
|
| 88 | +- Add mine() revset for personal commits |
| 89 | +- Improve default() revset with recent() filter |
| 90 | +- Add statistical output to log commands |
| 91 | +
|
| 92 | +fix(setup): resolve symlink creation on existing files |
| 93 | +
|
| 94 | +Handle case where target symlinks already exist by checking and removing |
| 95 | +stale links before creating new ones. |
| 96 | +
|
| 97 | +docs: update installation instructions |
| 98 | +
|
| 99 | +Add troubleshooting section and prerequisites clarification. |
| 100 | +``` |
0 commit comments