Compare commits

..

No commits in common. "02922ccc55b58a72b97f4d6c1640850c8031c6f0" and "6e983f08e89766097b4f7b4507f4400f9e491ebc" have entirely different histories.

3 changed files with 10 additions and 40 deletions

View File

@ -10,25 +10,14 @@ 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
@ -49,11 +38,7 @@ 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. 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
3. Commits changes in each modified repository with the provided message
4. Reports success/failure for each repository
## Use Case

View File

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

View File

@ -9,22 +9,15 @@ Commitly is a Babashka script located at `commitly/commitly` that commits and pu
## Usage
```bash
./commitly/commitly status # Show status of modified repos
./commitly/commitly [-p] <commit-message> # Commit (and push) changes
./commitly/commitly [-p] <commit-message>
```
### 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"
@ -44,11 +37,8 @@ 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. **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
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)
## When to Use
@ -61,7 +51,7 @@ The monorepo contains multiple independent git repositories:
- `www/` - Dashboard website
- `gateway/` - Nginx reverse proxy
- `commitly/` - This tool itself
- Other service repositories as needed
- `just-vibes/` - Other projects
Each has its own `.git` directory and is deployed independently via Gitea Actions when pushed to main.