-
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
Improved the 'git-info' command #755
base: main
Are you sure you want to change the base?
Conversation
Now that --no-config and --no-color are now both valid options, the shorter -n option is no longer obvious.
This option specifies the number of commits to show in the output (`<N>`).
echon "## Local Branches:" | ||
echon "$(local_branches)" | ||
if [[ "${max_count}" -ne 1 ]]; then | ||
header="Top ${max_count} Commits:" |
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.
IMHO, Top N Commits:
is vague. Actually we show the last N commits in the current branch.
$ git info --no-color | ||
``` | ||
|
||
You can select the number of previous commits to show by using the `-c <N>` option (where `<N>` is any integer). It is important to note, however, that `-c` **must be the FIRST option** you pass to `git info`. For example: |
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.
We can use a while loop to get rid of this limitation, like: https://github.com/tj/git-extras/blob/master/bin/git-release#L31
Added:
--no-color
option)-c <N>
option which allows the user to specify the number of commits to show in the output