From 9ded665dfc605ff7993c4959bf38c90a26a73a12 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 23 Jan 2025 11:30:05 -0800 Subject: [PATCH] Add branch option --- src/gitlogstats/__main__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gitlogstats/__main__.py b/src/gitlogstats/__main__.py index b716c52..6c1c811 100644 --- a/src/gitlogstats/__main__.py +++ b/src/gitlogstats/__main__.py @@ -45,6 +45,9 @@ def main(): "--repository", help="the public URL of the repository whose logs to parse", ) + group.add_argument( + "-b", "--branch", help="the branch to parse", + ) group.add_argument( "-rf", "--repofile", @@ -136,6 +139,11 @@ def main(): ["git", "pull"], capture_output=True, check=True ) # clone the code from github + if args.branch: + subprocess.run( + ["git", "checkout", args.branch], capture_output=True, check=True + ) # clone the code from github + git_logs_parser = GitLogsParser( repo=repo_dir, start=args.start,