694
694
"Zheitsev's Eruption" ,
695
695
]
696
696
697
- PREVIOUS_RELEASE_NAMES = []
697
+ PREVIOUS_RELEASE_NAMES = [
698
+ "Major Kong" ,
699
+ "Rowan's Call" ,
700
+ "Hand of Glory" ,
701
+ "Lethal Catch" ,
702
+ "White Elephant" ,
703
+ "Time Skip" ,
704
+ ]
698
705
699
706
700
707
@cache
701
- def get_git_commit_hash (identifier : str | None = None ) -> str :
708
+ def get_git_commit_hash (identifier : str = "HEAD" ) -> str :
702
709
"""
703
710
Gets the full commit hash of the current git repo.
704
711
705
712
Args:
706
- identifier: The identifier of the commit to get, or None to get the latest .
713
+ identifier: The identifier of the commit to get.
707
714
Returns:
708
715
The commit hash.
709
716
"""
710
- args = ["git" , "show" , "-s" , "--format=%H" ]
711
- if identifier is not None :
712
- args .append (identifier )
713
-
714
717
return subprocess .run (
715
- args ,
718
+ [ "git" , "rev-list" , "-1" , identifier ] ,
716
719
cwd = Path (__file__ ).parent ,
717
720
check = True ,
718
721
stdout = subprocess .PIPE ,
@@ -744,10 +747,10 @@ def pick_release_name(commit_hash: str, excludes: list[str] = PREVIOUS_RELEASE_N
744
747
description = "Picks the friendly name to use for the current release." ,
745
748
)
746
749
parser .add_argument (
747
- "hash " ,
750
+ "commit " ,
748
751
nargs = "?" ,
749
- default = None ,
750
- help = "The commit hash to base the name off of. If not given, retrieves from git ." ,
752
+ default = "HEAD" ,
753
+ help = "The commit hash to base the name off of. Defaults to HEAD ." ,
751
754
)
752
755
parser .add_argument (
753
756
"--exclude" ,
@@ -763,7 +766,7 @@ def pick_release_name(commit_hash: str, excludes: list[str] = PREVIOUS_RELEASE_N
763
766
)
764
767
args = parser .parse_args ()
765
768
766
- commit_hash = get_git_commit_hash (args .hash )
769
+ commit_hash = get_git_commit_hash (args .commit )
767
770
768
771
excludes = [] if args .ignore_previous_releases else PREVIOUS_RELEASE_NAMES
769
772
excludes += args .exclude
0 commit comments