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 (color, submodule, config) #867

Merged
merged 11 commits into from Aug 25, 2020

Conversation

yuravg
Copy link
Contributor

@yuravg yuravg commented Aug 21, 2020

Hi,
I see #755, but did something similar in another way

added:

  • info about submodules
  • colorized headers
  • extend info commit and repo configuration

note:

  • changes checked in MinGW, Debian Linux
  • I do not update git-extras-completion.zsh (I use bash only, and do not have zsh)

I hope this will be useful

bin/git-info Outdated
@@ -1,11 +1,26 @@
#!/usr/bin/env bash

get_config() {
git config --list
cmd_get_config="$(git config --get-all extras.info.config-grep)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we prefer to use git-extras as the namespace, like git config --get git-extras.pr.remote.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

bin/git-info Outdated
NORMAL="$(tput sgr0)"
if [ "$1" = "--color" ] || [ "$2" = "--color" ] || \
[ "$1" = "-c" ] || [ "$2" = "-c" ] ; then
COLOR_TITLE="$GREEN"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to mention that -c only affects the title in the documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

bin/git-info Outdated

if test "$1" != "--no-config"; then
echon "## Configuration (.git/config):"
if [ "$1" != "--no-config" ] && [ "$2" != "--no-config" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to move the argument checks together at the top of the script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@spacewander spacewander merged commit ecf0f48 into tj:master Aug 25, 2020
@spacewander
Copy link
Collaborator

@yuravg
Merged. Thanks!

@yuravg yuravg deleted the pr2source branch August 27, 2020 06:18
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.

None yet

2 participants