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 @@ -336,6 +336,12 @@ def __call__(
336
336
"help" : "Add additional build-metadata to the version-number" ,
337
337
"default" : None ,
338
338
},
339
+ {
340
+ "name" : ["--empty" ],
341
+ "default" : False ,
342
+ "help" : "bump tags without new commits" ,
343
+ "action" : "store_true" ,
344
+ },
339
345
],
340
346
},
341
347
{
Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ def __call__(self) -> None: # noqa: C901
159
159
manual_version = self .arguments ["manual_version" ]
160
160
build_metadata = self .arguments ["build_metadata" ]
161
161
increment_mode : str = self .arguments ["increment_mode" ]
162
+ is_empty : bool | None = self .arguments ["empty" ]
162
163
163
164
if manual_version :
164
165
if increment :
@@ -231,7 +232,7 @@ def __call__(self) -> None: # noqa: C901
231
232
232
233
# No commits, there is no need to create an empty tag.
233
234
# Unless we previously had a prerelease.
234
- if not commits and not current_version .is_prerelease :
235
+ if not commits and not current_version .is_prerelease and not is_empty :
235
236
raise NoCommitsFoundError (
236
237
"[NO_COMMITS_FOUND]\n " "No new commits found."
237
238
)
@@ -247,6 +248,10 @@ def __call__(self) -> None: # noqa: C901
247
248
"To avoid this error, manually specify the type of increment with `--increment`"
248
249
)
249
250
251
+ # we create an empty PATCH increment for empty tag
252
+ if increment is None and is_empty :
253
+ increment = "PATCH"
254
+
250
255
new_version = current_version .bump (
251
256
increment ,
252
257
prerelease = prerelease ,
You can’t perform that action at this time.
0 commit comments