694694 "Zheitsev's Eruption" ,
695695]
696696
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+ ]
698705
699706
700707@cache
701- def get_git_commit_hash (identifier : str | None = None ) -> str :
708+ def get_git_commit_hash (identifier : str = "HEAD" ) -> str :
702709 """
703710 Gets the full commit hash of the current git repo.
704711
705712 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.
707714 Returns:
708715 The commit hash.
709716 """
710- args = ["git" , "show" , "-s" , "--format=%H" ]
711- if identifier is not None :
712- args .append (identifier )
713-
714717 return subprocess .run (
715- args ,
718+ [ "git" , "rev-list" , "-1" , identifier ] ,
716719 cwd = Path (__file__ ).parent ,
717720 check = True ,
718721 stdout = subprocess .PIPE ,
@@ -744,10 +747,10 @@ def pick_release_name(commit_hash: str, excludes: list[str] = PREVIOUS_RELEASE_N
744747 description = "Picks the friendly name to use for the current release." ,
745748 )
746749 parser .add_argument (
747- "hash " ,
750+ "commit " ,
748751 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 ." ,
751754 )
752755 parser .add_argument (
753756 "--exclude" ,
@@ -763,7 +766,7 @@ def pick_release_name(commit_hash: str, excludes: list[str] = PREVIOUS_RELEASE_N
763766 )
764767 args = parser .parse_args ()
765768
766- commit_hash = get_git_commit_hash (args .hash )
769+ commit_hash = get_git_commit_hash (args .commit )
767770
768771 excludes = [] if args .ignore_previous_releases else PREVIOUS_RELEASE_NAMES
769772 excludes += args .exclude
0 commit comments