Commit 3edb288
Add --dry-run option to sync --read-remotes and sync --write-remotes.
When set, shows what would change without making any modifications.
Sync output is now TSV with direction header, column headers, and
per-remote status lines (added/removed/modified/unchanged). Repos with
no changes are silently skipped; repos with any change show all their
remotes. Read and write output is a symmetric mirror of each other.
write-remotes now also updates URLs for existing remotes (set-url),
not just adding missing ones. It will not remove any remotes.
Direction headers clarify what is being updated:
Updating .gitopolis.toml with values from git repo remotes...
Updating git repo remotes with values from .gitopolis.toml...
Rewrote sync e2e tests: 4 core tests (read/write x real/dry-run) each
cover added, removed, modified, unchanged, and no-remotes edge cases
with full TOML assertions. Added test helpers for git repo setup.
Fixes #214
Prompts:
- do this Add dry-run arg for sync commands · Issue #214 · timabell/gitopolis
- (approved plan)
- commit (x4, rejected cat/heredoc/tempfile approaches)
- commit - bbc60c3
- dry run should output what it is changing to, and needs a clearer message in both directions for all repos. output all the before/after urls
- newlines between repos
- direction isn't clear, output needs to somehow indicate config->repo
- skip repos with no change but show all remotes for repos with any change
- new output format (provided example: reponame status remote url [url])
- include headers for tsv
- i didn't get any output for read but did for write, what gives
- Updating git repo remotes with values from .gitopolis.toml ...
- ideally we'd have 4 tests for read/write dry/real covering added/removed/unchanged plus edge cases
- these should be an exact mirror no? (showed asymmetric output)
- don't output no changes that's not unixy
- always assert full toml. write prompt list so far to a temp file in repo before compaction
- fork URL not changed (write-remotes doesn't modify) - it should
- okay to not remove remotes though (add to command doc that it won't remove any remotes)
- yes, and remember prompts from tmp file and since then
- amend last commit, expanding description, keep subject line intact
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 011c88e commit 3edb288
5 files changed
Lines changed: 479 additions & 125 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
78 | 92 | | |
79 | 93 | | |
80 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
153 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
161 | 194 | | |
162 | | - | |
163 | 195 | | |
164 | 196 | | |
165 | 197 | | |
| |||
169 | 201 | | |
170 | 202 | | |
171 | 203 | | |
172 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
173 | 207 | | |
174 | 208 | | |
175 | 209 | | |
| |||
179 | 213 | | |
180 | 214 | | |
181 | 215 | | |
182 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
183 | 237 | | |
184 | 238 | | |
185 | 239 | | |
186 | | - | |
187 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
188 | 243 | | |
189 | 244 | | |
190 | 245 | | |
| |||
194 | 249 | | |
195 | 250 | | |
196 | 251 | | |
197 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
198 | 256 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
202 | 279 | | |
203 | 280 | | |
204 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| 194 | + | |
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
195 | 199 | | |
196 | | - | |
| 200 | + | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
200 | | - | |
| 204 | + | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
| |||
0 commit comments