@@ -104,6 +104,8 @@ def get_config() -> Dict[str, Union[str, int]]:
104104 - 'enable' to use the user's default merge view from the conf.
105105 Default is usually to show both regular and merge commits.
106106 - Any other value defaults to '--no-merges' currently.
107+ _GIT_BRANCH (str): Sets branch you want to target for some stats.
108+ Default is empty which falls back to the current branch you're on.
107109 _GIT_LIMIT (int): Limits the git log output. Defaults to 10.
108110 _GIT_LOG_OPTIONS (str): Additional git log options. Default is empty.
109111 _GIT_DAYS (int): Defines number of days for the heatmap. Default is empty.
@@ -124,10 +126,11 @@ def get_config() -> Dict[str, Union[str, int]]:
124126 - 'until' (str): Git command option for the end date.
125127 - 'pathspec' (str): Git command option for pathspec.
126128 - 'merges' (str): Git command option for merge commit view strategy.
129+ - 'branch' (str): Git branch name.
127130 - 'limit' (int): Git log output limit.
128131 - 'log_options' (str): Additional git log options.
129- - 'sort_by' (str): Sort by field and sort direction (asc/desc).
130132 - 'days' (str): Number of days for the heatmap.
133+ - 'sort_by' (str): Sort by field and sort direction (asc/desc).
131134 - 'ignore_authors': (str): Any author(s) to ignore.
132135 - 'menu_theme' (str): Menu theme color.
133136 """
@@ -173,6 +176,13 @@ def get_config() -> Dict[str, Union[str, int]]:
173176 else :
174177 config ["merges" ] = "--no-merges"
175178
179+ # _GIT_BRANCH
180+ git_branch : Optional [str ] = os .environ .get ("_GIT_BRANCH" )
181+ if git_branch :
182+ config ["branch" ] = git_branch
183+ else :
184+ config ["branch" ] = ""
185+
176186 # _GIT_LIMIT
177187 git_limit : Optional [str ] = os .environ .get ("_GIT_LIMIT" )
178188 if git_limit :
0 commit comments