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

Improved the 'git-info' command #755

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

bbugyi200
Copy link

@bbugyi200 bbugyi200 commented Jun 2, 2019

Added:

  • colored output to git-info (can be disabled with the --no-color option)
  • new -c <N> option which allows the user to specify the number of commits to show in the output

@bbugyi200 bbugyi200 changed the title Add: colored output to git-info Improved the 'git-info' command Jun 2, 2019
echon "## Local Branches:"
echon "$(local_branches)"
if [[ "${max_count}" -ne 1 ]]; then
header="Top ${max_count} Commits:"
Copy link
Collaborator

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:
Copy link
Collaborator

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

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

Successfully merging this pull request may close these issues.

2 participants