Skip to content

Commit 0a87d53

Browse files
authored
feat: '--tags' for auto push mode to include --follow-tags (pushes annotated tags) (#40)
* 'push --tags' mode to include --follow-tags in push auto mode * cleanup: push auto/manual with switch * fix: reinclude echo and linebreaks * push: echo at the correct place * cleanup: remove commented part which is not used * fix: typo
1 parent 79b9681 commit 0a87d53

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

conf.d/gitnow.fish

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,41 @@ function push -d "Gitnow: Push commit changes to remote repository"
176176
set -l xorigin (__gitnow_current_remote)
177177
set -l xbranch (__gitnow_current_branch_name)
178178

179-
echo "🚀 Pushing changes..."
180179

181180
if test (count $opts) -eq 0
182181
set opts $xorigin $xbranch
183182
set -l xremote_url (command git config --get "remote.$xorigin.url")
184183

184+
echo "🚀 Pushing changes..."
185185
echo "Mode: Auto"
186186
echo "Remote URL: $xorigin ($xremote_url)"
187187
echo "Remote branch: $xbranch"
188188
else
189-
echo "Mode: Manual"
189+
set -l v_mode "auto"
190+
191+
for v in $argv
192+
switch $v
193+
case -t --tags
194+
set opts $xorigin $xbranch --follow-tags
195+
set -l xremote_url (command git config --get "remote.$xorigin.url")
196+
197+
echo "🚀 Pushing changes..."
198+
echo "Mode: Auto (incl. tags)"
199+
echo "Remote URL: $xorigin ($xremote_url)"
200+
echo "Remote branch: $xbranch"
201+
case -h --help
202+
echo "NAME"
203+
echo " Gitnow: push - Push current branch to default origin"
204+
echo "OPTIONS:"
205+
echo " -t --tags (auto mode) include annotated tags that relate to the commits"
206+
echo " -h --help Show information about the options for this command"
207+
return
208+
case -\*
209+
case '*'
210+
set -l v_mode "manual"
211+
echo "Mode: Manual"
212+
end
213+
end
190214
end
191215

192216
echo

0 commit comments

Comments
 (0)