@@ -495,6 +495,8 @@ function tag -d "Gitnow: Tag commits following Semver"
495
495
set -l v_preminor
496
496
set -l v_prepatch
497
497
498
+ set -l opts
499
+
498
500
# NOTE: this function only gets the latest *Semver release version* but no suffixed ones or others
499
501
set -l v_latest (__gitnow_get_latest_semver_release_tag)
500
502
@@ -506,6 +508,8 @@ function tag -d "Gitnow: Tag commits following Semver"
506
508
set v_minor $v
507
509
case -z --patch
508
510
set v_patch $v
511
+ case -a --annotate
512
+ set opts $opts $v
509
513
510
514
# TODO: pre-release versions are not supported yet
511
515
# case -a --premajor
@@ -537,6 +541,7 @@ function tag -d "Gitnow: Tag commits following Semver"
537
541
echo " -y --minor Tag auto-incrementing a minor version number"
538
542
echo " -z --patch Tag auto-incrementing a patch version number"
539
543
echo " -l --latest Show only the latest Semver release tag version (no suffixed ones or others)"
544
+ echo " -a --annotate Create as annotated tag"
540
545
echo " -h --help Show information about the options for this command"
541
546
542
547
# TODO: pre-release versions are not supported yet
@@ -552,15 +557,15 @@ function tag -d "Gitnow: Tag commits following Semver"
552
557
end
553
558
554
559
# List all tags in a lexicographic order and treating tag names as versions
555
- if test -z $argv
560
+ if test -z " $argv "
556
561
__gitnow_get_tags_ordered
557
562
return
558
563
end
559
564
560
565
# Major version tags
561
566
if test -n " $v_major "
562
567
if not test -n " $v_latest "
563
- command git tag v1.0.0
568
+ command git tag $opts v1.0.0
564
569
echo " First major tag \" v1.0.0\" was created."
565
570
return
566
571
else
@@ -577,7 +582,7 @@ function tag -d "Gitnow: Tag commits following Semver"
577
582
set x (__gitnow_increment_number $x )
578
583
set -l xyz " $prefix$x .0.0"
579
584
580
- command git tag $xyz
585
+ command git tag $opts $ xyz
581
586
echo " Major tag \" $xyz \" was created."
582
587
return
583
588
end
@@ -587,7 +592,7 @@ function tag -d "Gitnow: Tag commits following Semver"
587
592
# Minor version tags
588
593
if test -n " $v_minor "
589
594
if not test -n " $v_latest "
590
- command git tag v0.1.0
595
+ command git tag $opts v0.1.0
591
596
echo " First minor tag \" v0.1.0\" was created."
592
597
return
593
598
else
@@ -605,7 +610,7 @@ function tag -d "Gitnow: Tag commits following Semver"
605
610
set y (__gitnow_increment_number $y )
606
611
set -l xyz " $prefix$x .$y .0"
607
612
608
- command git tag $xyz
613
+ command git tag $opts $ xyz
609
614
echo " Minor tag \" $xyz \" was created."
610
615
return
611
616
end
@@ -615,7 +620,7 @@ function tag -d "Gitnow: Tag commits following Semver"
615
620
# Patch version tags
616
621
if test -n " $v_patch "
617
622
if not test -n " $v_latest "
618
- command git tag v0.0.1
623
+ command git tag $opts v0.0.1
619
624
echo " First patch tag \" v0.1.0\" was created."
620
625
return
621
626
else
@@ -637,7 +642,7 @@ function tag -d "Gitnow: Tag commits following Semver"
637
642
set s (__gitnow_increment_number $s )
638
643
set -l xyz " $prefix$x .$y .$s "
639
644
640
- command git tag $xyz
645
+ command git tag $opts $ xyz
641
646
echo " Patch tag \" $xyz \" was created."
642
647
else
643
648
echo " No patch version found."
0 commit comments