-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Change the oneline option to a tebular version in the git summary #1031
Conversation
Closes #1023 |
@@ -221,11 +221,12 @@ project : git-extras | |||
|
|||
The `--line` option can also take a path, which will print a filtered summary for that folder or file. | |||
|
|||
The option `--oneline` tries to put as much summary information of the repo into a single output line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest keeping the oneline output as another output style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Now both styles are supported
bin/git-summary
Outdated
print_summary_by_line() { | ||
if [ "$OUTPUT_STYLE" == "tabular" ]; then | ||
tabular_headers="# Repo | Lines" | ||
echo -e "$tabular_headers\n$project | $(line_count "${paths[@]}")" | column -t -s "|" -o "|" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running this, I get:
column: invalid option -- 'o'
usage: column [-txne] [-c columns] [-s sep] [file ...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that is weired. What OS and do you use and what version of column
do you have. According to https://man7.org/linux/man-pages/man1/column.1.html the -o
option is there and on my ubuntu 22.04 it's also working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
man column
show that:
HISTORY
The column command appeared in 4.3BSD-Reno.
There is not version output option in my column
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checked. The BSD column command just doesn't have the -o
option. I have to think about this how to solve it because the -o
would be quite important to have a separator between columns, else my overall-command can't distinguish the single columns...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got rid of the -o
option.
Let's merge master to make CI pass. |
Done. |
…#1031) Co-authored-by: guenthgr <[email protected]>
Hi,
I've change the
git summary --oneline
togit summary --output-style tabular
which gives an output like this:When this is combined with the git bulk command, and some other bash magic, then this result can be achieved:
The main advantage is, that the redundant header information stays just in the header and not pollutes the single lines any more.