File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,12 @@ def __call__(
371
371
"help" : "Determine the next version and write to stdout" ,
372
372
"default" : False ,
373
373
},
374
+ {
375
+ "name" : ["--empty" ],
376
+ "default" : False ,
377
+ "help" : "bump tags without new commits" ,
378
+ "action" : "store_true" ,
379
+ },
374
380
],
375
381
},
376
382
{
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ def __call__(self) -> None: # noqa: C901
160
160
build_metadata = self .arguments ["build_metadata" ]
161
161
increment_mode : str = self .arguments ["increment_mode" ]
162
162
get_next : bool = self .arguments ["get_next" ]
163
+ is_empty : bool | None = self .arguments ["empty" ]
163
164
164
165
if manual_version :
165
166
if increment :
@@ -250,7 +251,7 @@ def __call__(self) -> None: # noqa: C901
250
251
251
252
# No commits, there is no need to create an empty tag.
252
253
# Unless we previously had a prerelease.
253
- if not commits and not current_version .is_prerelease :
254
+ if not commits and not current_version .is_prerelease and not is_empty :
254
255
raise NoCommitsFoundError (
255
256
"[NO_COMMITS_FOUND]\n No new commits found."
256
257
)
@@ -266,6 +267,10 @@ def __call__(self) -> None: # noqa: C901
266
267
"To avoid this error, manually specify the type of increment with `--increment`"
267
268
)
268
269
270
+ # we create an empty PATCH increment for empty tag
271
+ if increment is None and is_empty :
272
+ increment = "PATCH"
273
+
269
274
new_version = current_version .bump (
270
275
increment ,
271
276
prerelease = prerelease ,
You can’t perform that action at this time.
0 commit comments