Compare commits

...

2 Commits

Author SHA1 Message Date
02922ccc55 update docs 2026-01-05 02:43:46 -05:00
9fecfeee46 update docs 2026-01-05 02:42:15 -05:00
3 changed files with 40 additions and 10 deletions

View File

@ -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
- `<message>`: Commits changes in each modified repository with the provided message
- `-p <message>`: Commits and pushes changes to remote
- `-p` (no message): Pushes all repositories without committing
4. Reports success/failure for each repository
## Use Case

View File

@ -18,11 +18,16 @@
(not (str/blank? (:out result)))))
(defn find-subrepos [parent-dir]
"Find all git repositories in parent directory"
(->> (fs/list-dir parent-dir)
"Find all git repositories in parent directory, including parent itself"
(let [child-repos (->> (fs/list-dir parent-dir)
(filter fs/directory?)
(filter git-repo?)
(map str)))
(map str))
parent-is-repo? (git-repo? parent-dir)
repos (if parent-is-repo?
(cons (str parent-dir) child-repos)
child-repos)]
repos))
(defn commit-changes [repo-path message]
"Commit all changes in repository with given message"

View File

@ -9,15 +9,22 @@ Commitly is a Babashka script located at `commitly/commitly` that commits and pu
## Usage
```bash
./commitly/commitly [-p] <commit-message>
./commitly/commitly status # Show status of modified repos
./commitly/commitly [-p] <commit-message> # 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 "<message>"` 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
- `<message>`: Runs `git add -A` and `git commit -m "<message>"` for each modified repo
- `-p <message>`: 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.