From ec417833ee1801a7ffeddae7bafb03401e678e99 Mon Sep 17 00:00:00 2001 From: Yuriy VG Date: Fri, 21 Aug 2020 17:51:19 +0300 Subject: [PATCH] doc: add description for git-info --- Commands.md | 9 +++++++-- man/git-info.md | 46 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/Commands.md b/Commands.md index 2aec3ac..7055544 100644 --- a/Commands.md +++ b/Commands.md @@ -750,6 +750,13 @@ $ git info myBranch * master + ## Submodule(s): + + a234567 path2submodule1/submodule1 (branch/tag) + + b234567 path2submodule2/submodule2 (branch/tag) + - c234567 path2submodule3/submodule3 (branch/tag) + e234567 path2submodule4/submodule4 (branch/tag) + ## Most Recent Commit: commit e3952df2c172c6f3eb533d8d0b1a6c77250769a7 @@ -757,8 +764,6 @@ $ git info Added git-info command. - Type 'git log' for more commits, or 'git show ' for full commit details. - ## Configuration (.git/config): color.diff=auto diff --git a/man/git-info.md b/man/git-info.md index bce8cda..ddec0d2 100644 --- a/man/git-info.md +++ b/man/git-info.md @@ -3,7 +3,7 @@ git-info(1) -- Returns information on current repository ## SYNOPSIS -`git-info` +`git-info` [-c|--color] [--no-config] ## DESCRIPTION @@ -12,12 +12,41 @@ Shows the following information about a repository: 1. Remote Url(s) 2. Remote Branches 3. Local Branches - 4. Most recent commit - 5. Configuration Info + 4. Submodule(s) (if present) + 5. Most recent commit + 6. Configuration Info ## OPTIONS -N/A + -c, --color + + Use color output. + + --no-config + + Don't show list all variables set in config file, along with their values. + +## GIT CONFIGS + + You could customize the Most recent commit and Configuration Info format via git config options + + $ git config --global --add extras.info.log "" + + the default is "git log --max-count=1 --pretty=short" + + $ git config --global --add extras.info.config-grep "" + + the default is "git config --list" + + For example, + + to set global configuration to show last commit subject, without sha1 + + $ git config --global --add extras.info.log "git log --max-count=1 --format=\"Author: %an%nDate: %ad (%ar)%n%n %s\" --date=format:\"%Y-%m-%d %a %H:%M\"" + + to set global configuration to show user's name and email + + $ git config --global --add extras.info.config-grep "git config --list | grep --color=never -E \"^user.name|^user.email\"" ## EXAMPLES @@ -40,6 +69,13 @@ Outputs info about a repo: myBranch * master + ## Submodule(s): + + a234567 path2submodule1/submodule1 (branch/tag) + + b234567 path2submodule2/submodule2 (branch/tag) + - c234567 path2submodule3/submodule3 (branch/tag) + e234567 path2submodule4/submodule4 (branch/tag) + ## Most Recent Commit: commit e3952df2c172c6f3eb533d8d0b1a6c77250769a7 @@ -47,8 +83,6 @@ Outputs info about a repo: Added git-info command. - Type 'git log' for more commits, or 'git show ' for full commit details. - ## Configuration (.git/config): color.diff=auto