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 209
209
"default" : None ,
210
210
"choices" : version_types .VERSION_TYPES ,
211
211
},
212
+ {
213
+ "name" : ["--empty" ],
214
+ "default" : False ,
215
+ "help" : "bump tags without new commits" ,
216
+ "action" : "store_true" ,
217
+ },
212
218
],
213
219
},
214
220
{
Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ def __call__(self): # noqa: C901
121
121
is_files_only : Optional [bool ] = self .arguments ["files_only" ]
122
122
is_local_version : Optional [bool ] = self .arguments ["local_version" ]
123
123
manual_version = self .arguments ["manual_version" ]
124
+ is_empty : Optional [bool ] = self .arguments ["empty" ]
124
125
125
126
if manual_version :
126
127
if increment :
@@ -175,7 +176,7 @@ def __call__(self): # noqa: C901
175
176
176
177
# No commits, there is no need to create an empty tag.
177
178
# Unless we previously had a prerelease.
178
- if not commits and not current_version_instance .is_prerelease :
179
+ if not commits and not current_version_instance .is_prerelease and not is_empty :
179
180
raise NoCommitsFoundError ("[NO_COMMITS_FOUND]\n " "No new commits found." )
180
181
181
182
if manual_version :
@@ -208,6 +209,10 @@ def __call__(self): # noqa: C901
208
209
if prerelease and current_version_instance .is_prerelease :
209
210
increment = None
210
211
212
+ # we create an empty PATCH increment for empty tag
213
+ if increment is None and is_empty :
214
+ increment = "PATCH"
215
+
211
216
new_version = bump .generate_version (
212
217
current_version ,
213
218
increment ,
You can’t perform that action at this time.
0 commit comments