gitlogstats 1.0.5__tar.gz → 1.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitlogstats
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Track developers' contributions to one or more git repositories within a particular time range.
5
5
  Project-URL: Homepage, https://github.com/bloombar/git-developer-contribution-analysis
6
6
  Project-URL: Repository, https://github.com/bloombar/git-developer-contribution-analysis.git
@@ -720,7 +720,7 @@ e.g. `pip install gitlogstats`, `pip3 install gitlogstats`, depending on your en
720
720
  The command `gitlogstats --help` shows the usage instructions:
721
721
 
722
722
  ```
723
- usage: gitlogstats [-h] (-r REPOSITORY | -rf REPOFILE) [-u USER] [-s START] [-e END] [-x EXCLUSIONS] [-f {csv,json,markdown}] [-v] [-c]
723
+ usage: gitlogstats [-h] (-r REPOSITORY | -rf REPOFILE) [-u USER] [-s START] [-e END] [-x EXCLUSIONS] [-f {csv,json,markdown}] [-b BRANCH] [-v] [-c]
724
724
 
725
725
  optional arguments:
726
726
  -h, --help show this help message and exit
@@ -736,6 +736,8 @@ optional arguments:
736
736
  A comma-separated string of files to exclude, e.g. --excusions "foo.zip, *.jpg, *.json"
737
737
  -f {csv,json,markdown}, --format {csv,json,markdown}
738
738
  The format in which to output the results
739
+ -b BRANCH, --branch BRANCH
740
+ The branch to checkout before compiling statistics. Defaults to the repository's default branch.
739
741
  -v, --verbose Whether to output debugging info
740
742
  -c, --clean Remove contributors without any contribuition
741
743
  ```
@@ -24,7 +24,7 @@ e.g. `pip install gitlogstats`, `pip3 install gitlogstats`, depending on your en
24
24
  The command `gitlogstats --help` shows the usage instructions:
25
25
 
26
26
  ```
27
- usage: gitlogstats [-h] (-r REPOSITORY | -rf REPOFILE) [-u USER] [-s START] [-e END] [-x EXCLUSIONS] [-f {csv,json,markdown}] [-v] [-c]
27
+ usage: gitlogstats [-h] (-r REPOSITORY | -rf REPOFILE) [-u USER] [-s START] [-e END] [-x EXCLUSIONS] [-f {csv,json,markdown}] [-b BRANCH] [-v] [-c]
28
28
 
29
29
  optional arguments:
30
30
  -h, --help show this help message and exit
@@ -40,6 +40,8 @@ optional arguments:
40
40
  A comma-separated string of files to exclude, e.g. --excusions "foo.zip, *.jpg, *.json"
41
41
  -f {csv,json,markdown}, --format {csv,json,markdown}
42
42
  The format in which to output the results
43
+ -b BRANCH, --branch BRANCH
44
+ The branch to checkout before compiling statistics. Defaults to the repository's default branch.
43
45
  -v, --verbose Whether to output debugging info
44
46
  -c, --clean Remove contributors without any contribuition
45
47
  ```
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  name = "gitlogstats"
7
7
  description = "Track developers' contributions to one or more git repositories within a particular time range."
8
- version = "1.0.5"
8
+ version = "1.0.6"
9
9
  authors = [
10
10
  { name="Tobody Tothing", email="nobody.nothing@nowhere.com" },
11
11
  ]
@@ -75,6 +75,12 @@ def main():
75
75
  default="csv",
76
76
  choices=["csv", "json", "markdown"],
77
77
  )
78
+ parser.add_argument(
79
+ "-b",
80
+ "--branch",
81
+ help="The branch to parse, if not the default branch",
82
+ default=None,
83
+ )
78
84
  parser.add_argument(
79
85
  "-v",
80
86
  "--verbose",
@@ -138,6 +144,11 @@ def main():
138
144
  ["git", "pull"], capture_output=True, check=True
139
145
  ) # clone the code from github
140
146
 
147
+ if args.branch:
148
+ subprocess.run(
149
+ ["git", "checkout", args.branch], capture_output=True, check=True
150
+ )
151
+
141
152
  last_parser = GitLogsParser(
142
153
  repo=repo_dir,
143
154
  start=args.start,
@@ -150,7 +161,9 @@ def main():
150
161
  results = last_parser.parse()
151
162
 
152
163
  if args.format == "json":
153
- all_results.extend(results) # collect across repos; emit one valid JSON array
164
+ all_results.extend(
165
+ results
166
+ ) # collect across repos; emit one valid JSON array
154
167
  else:
155
168
  print(last_parser.format_results(results, args.format))
156
169
 
File without changes
File without changes
File without changes
File without changes
File without changes