You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add field configuration support for customizable CSV output
- Add -c/--config option to specify field configuration CSV file
- Add LoadFieldConfig() function to parse Field_Name,Should_Fetch format
- Add IsFieldEnabled() function to check if a field should be included
- Add BuildOutputRow() function to dynamically build output based on config
- Add GetAllBranchesWithLatestCommit() for repos with >100 branches
- Update README with new configuration options and examples
- Include sample fields-config.csv file
- `Created`: Date/time when the repository was created
117
+
118
+
## Field Configuration
119
+
120
+
You can customize which fields are included in the output by using a field configuration CSV file with the `-c` or `--config` option. This is useful when you only need specific fields and want to reduce the output size.
121
+
122
+
### Configuration File Format
123
+
124
+
Create a CSV file with the following format:
125
+
126
+
```csv
127
+
Field_Name,Should_Fetch
128
+
Org_Name,true
129
+
Repo_Name,true
130
+
Is_Empty,false
131
+
Last_Push,true
132
+
...
133
+
```
134
+
135
+
- `Field_Name`: The name of the field (must match exactly)
136
+
- `Should_Fetch`: `true` to include the field, `false` to exclude it
137
+
138
+
### Example Configuration File
139
+
140
+
A sample configuration file `fields-config.csv` is provided in the repository with all fields enabled. You can copy and modify it to suit your needs:
141
+
142
+
```shell
143
+
# Use custom field configuration
144
+
gh repo-stats -o my-org-name -c fields-config.csv
145
+
```
146
+
147
+
### Available Fields
148
+
149
+
| Field Name | Description |
150
+
|------------|-------------|
151
+
| `Org_Name` | Organization login |
152
+
| `Repo_Name` | Repository name |
153
+
| `Is_Empty` | Whether the repository is empty |
154
+
| `Last_Push` | Date/time when a push was last made |
155
+
| `Last_Update` | Date/time when an update was last made |
156
+
| `Latest_Commit_SHA` | SHA of the most recent commit |
157
+
| `Latest_Committed_At` | Date/time of the most recent commit |
158
+
| `Latest_Commit_Branch` | Branch of the most recent commit |
159
+
| `Default_Branch` | Default branch of the repository |
160
+
| `isFork` | Whether the repository is a fork |
161
+
| `isArchived` | Whether the repository is archived |
162
+
| `Repo_Size_mb` | Size of the repository in MB |
163
+
| `Record_Count` | Number of database records |
164
+
| `Collaborator_Count` | Number of collaborators |
165
+
| `Protected_Branch_Count` | Number of branch protection rules |
166
+
| `PR_Review_Count` | Number of pull request reviews |
167
+
| `Milestone_Count` | Number of milestones |
168
+
| `Issue_Count` | Number of issues |
169
+
| `PR_Count` | Number of pull requests |
170
+
| `PR_Review_Comment_Count` | Number of PR review comments |
171
+
| `Commit_Comment_Count` | Number of commit comments |
172
+
| `Issue_Comment_Count` | Number of issue comments |
173
+
| `Issue_Event_Count` | Number of issue events |
174
+
| `Release_Count` | Number of releases |
175
+
| `Project_Count` | Number of projects |
176
+
| `Branch_Count` | Number of branches |
177
+
| `Tag_Count` | Number of tags |
178
+
| `Discussion_Count` | Number of discussions |
179
+
| `Has_Wiki` | Whether wiki is enabled |
180
+
| `Full_URL` | Repository URL |
181
+
| `Migration_Issue` | Migration issue indicator |
182
+
| `Created` | Repository creation date |
183
+
184
+
**Note**: If no configuration file is specified or the file doesn't exist, all fields will be fetched by default.
0 commit comments