Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to slim the git bulk -q summary --oneline command [Request for ideas] #1023

Closed
guenhter opened this issue Jan 18, 2023 · 4 comments
Closed

Comments

@guenhter
Copy link
Contributor

guenhter commented Jan 18, 2023

Hi,

when you combine the commands git bulk and git summary --oneline you get a very nice overview of your all your current repos like this:

$ git bulk -q summary --oneline | column -t -s /                                                                                                                                                           
Core command "summary" accepted.
deno-data-handler-prototype          age: 7 weeks                last active: 5 weeks ago             active on 5 days      commits: 21      uncommitted: 0
udp-handler                          age: 7 weeks                last active: 7 weeks ago             active on 1 days      commits: 4       uncommitted: 0
azure-client                         age: 7 weeks                last active: 7 weeks ago             active on 1 days      commits: 3       uncommitted: 0
dev-infrastructure-automation        age: 6 weeks                last active: 2 hours ago             active on 13 days     commits: 23      uncommitted: 0
gitlab-project-settings-corrector    age: 3 months               last active: 2 days ago              active on 2 days      commits: 3       uncommitted: 0
free-for-all                         age: 2 days                 last active: 2 days ago              active on 1 days      commits: 2       uncommitted: 0
realm-initializer                    age: 3 months               last active: 2 days ago              active on 6 days      commits: 23      uncommitted: 0
gitlab-k8s-cleaner                   age: 3 months               last active: 3 months ago            active on 2 days      commits: 7       uncommitted: 0
...

Event though it is pretty nice, there is much redundant information (like the title of each command is contained in each line in each column) what makes it hard to just catch the relevant information.

What I'd have in mind is something like this:

$ git bulk -q summary ......
Core command "summary" accepted.

Project Name                         Age        Last Active    Active On   Commits Uncommited
deno-data-handler-prototype          7 weeks    5 weeks ago    5 days      21      0
udp-handler                          7 weeks    7 weeks ago    1 days      4       0
azure-client                         7 weeks    7 weeks ago    1 days      3       0
dev-infrastructure-automation        6 weeks    2 hours ago    13 days     23      0
gitlab-project-settings-corrector    3 months   2 days ago     2 days      3       0
free-for-all                         2 days     2 days ago     1 days      2       0
realm-initializer                    3 months   2 days ago     6 days      23      0
gitlab-k8s-cleaner                   3 months   3 months ago   2 days      7       0
....

This would be slimmer.

The Problem: Git summary doesn't know that it is used in a bulk command and therefore just prints the title on each field.
I'm more than willing to implement this, but I want to collect ideas how this can be archived the best.

@spacewander
Copy link
Collaborator

The (maybe) simplest one: use pipeline. For instance, git bulk -q summary ...... | a python script.

@guenhter
Copy link
Contributor Author

I'd somehow favor to add this in some way to the tool so that others can use it as well. Having in in a python script on my end means I have to create some code what is only there for me.

@guenhter
Copy link
Contributor Author

What do you think of this approaches:

  1. The "git bulk summary" is specially treated and knows what do do. Then no --oneline | column -t -s / is needed any more because the command is doing the job
  2. The git summary command is able to print out the information of the repo in a tabelar form: 1st row are the headers, 2nd row are the data. This is done for each repo and I simply ignore the headers then with git bulk -q summary --oneline | grep something-to-swallow-headers | column -t -s /| but I keep the very first header.

@spacewander
Copy link
Collaborator

I vote for the second one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants