diff --git a/README.md b/README.md index bf27514..a59f0f1 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,25 @@ A CLI tool for making commits to many subrepos after a distributed change. - Automatically detects which subrepos have uncommitted changes - Creates commits with a single message across all modified subrepos +- Push changes to remote repositories after committing +- View status of all modified repositories - Reports commit status for each subrepo - Written in Babashka for fast startup and easy distribution ## Usage ```bash +# Show status of all modified subrepos +./commitly status + # Commit changes across all modified subrepos ./commitly "Your commit message here" + +# Commit and push changes +./commitly -p "Your commit message here" + +# Push only (without committing) +./commitly -p ``` ## Requirements @@ -38,7 +49,11 @@ ln -s $(pwd)/commitly /usr/local/bin/commitly 1. Scans parent directory for git repositories 2. Checks each repository for uncommitted changes (staged or unstaged) -3. Commits changes in each modified repository with the provided message +3. Depending on the command: + - `status`: Shows git status for all modified repositories + - ``: Commits changes in each modified repository with the provided message + - `-p `: Commits and pushes changes to remote + - `-p` (no message): Pushes all repositories without committing 4. Reports success/failure for each repository ## Use Case diff --git a/skills/commitly/commitly.md b/skills/commitly/commitly.md index d106dd5..6628d50 100644 --- a/skills/commitly/commitly.md +++ b/skills/commitly/commitly.md @@ -9,15 +9,22 @@ Commitly is a Babashka script located at `commitly/commitly` that commits and pu ## Usage ```bash -./commitly/commitly [-p] +./commitly/commitly status # Show status of modified repos +./commitly/commitly [-p] # Commit (and push) changes ``` ### Options +- `status` - Show git status for all modified repositories - `-p` - Push changes after committing. If no commit message is provided with `-p`, it will skip committing and just push all subrepos. ### Examples +**Show status of all modified repos:** +```bash +./commitly/commitly status +``` + **Commit all modified repos with a message:** ```bash ./commitly/commitly "fix: update configuration" @@ -37,8 +44,11 @@ Commitly is a Babashka script located at `commitly/commitly` that commits and pu 1. **Discovery**: Scans the current directory for subdirectories containing `.git` folders 2. **Detection**: Checks each repository for uncommitted changes using `git status --porcelain` -3. **Commit**: Runs `git add -A` and `git commit -m ""` for each modified repo -4. **Push**: If `-p` flag is present, runs `git push` for each successfully committed repo (or all repos if no message provided) +3. **Action**: Depending on the command: + - `status`: Shows full `git status` output for each modified repo + - ``: Runs `git add -A` and `git commit -m ""` for each modified repo + - `-p `: Commits and then runs `git push` for each successfully committed repo + - `-p` (no message): Runs `git push` for all repos without committing ## When to Use @@ -51,7 +61,7 @@ The monorepo contains multiple independent git repositories: - `www/` - Dashboard website - `gateway/` - Nginx reverse proxy - `commitly/` - This tool itself -- `just-vibes/` - Other projects +- Other service repositories as needed Each has its own `.git` directory and is deployed independently via Gitea Actions when pushed to main.