{"thread":{"id":"6206","subject":"[PATCH] Add documentation for git-branch's color configuration.","startedAt":"2007-01-03T15:36:29Z","lastAt":"2007-01-03T15:36:29Z","messageCount":1,"participants":["Brian Gernhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"30755","messageId":"20070103153629.GA9754@182.242.249.10.in-addr.arpa","threadId":"6206","inReplyTo":null,"subject":"[PATCH] Add documentation for git-branch's color configuration.","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-01-03T15:36:29Z","receivedAt":"2007-01-03T15:36:29Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"Added color.branch and color.branch.<slot> to configuration list.\nStyle copied from color.status and meanings derived from the code.\n\nMoved the color meanings from color.diff.<slot> to color.branch.<slot>\nsince the latter comes first alphabetically.\n\nAdded --color and --no-color to git-branch's usage and documentation.\n\nSigned-off-by: Brian Gernhardt <benji@silverinsanity.com>\n---\n\n When looking through the code, I noticed that git-branch had color\n options.  Who knew?  Not me.\n\n I checked, but couldn't find, any other color options to document.\n\n Documentation/config.txt     |   24 ++++++++++++++++++------\n Documentation/git-branch.txt |    9 ++++++++-\n builtin-branch.c             |    2 +-\n 3 files changed, 27 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 2f4fc25..4318bf9 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -145,6 +145,21 @@ branch.<name>.merge::\n \tthis option, `git pull` defaults to merge the first refspec fetched.\n \tSpecify multiple values to get an octopus merge.\n \n+color.branch::\n+\tA boolean to enable/disable color in the output of\n+\tgitlink:git-branch[1]. May be set to `true` (or `always`),\n+\t`false` (or `never`) or `auto`, in which case colors are used\n+\tonly when the output is to a terminal. Defaults to false.\n+\n+color.branch.<slot>::\n+\tUse customized color for branch coloration. `<slot>` is one of\n+\t`current` (the current branch), `local` (a local branch),\n+\t`remote` (a tracking branch in refs/remotes/), `plain` (other\n+\trefs), or `reset` (the normal terminal color).  The value for\n+\tthese configuration variables can be one of: `normal`, `bold`,\n+\t`dim`, `ul`, `blink`, `reverse`, `reset`, `black`, `red`,\n+\t`green`, `yellow`, `blue`, `magenta`, `cyan`, or `white`.\n+\n color.diff::\n \tWhen true (or `always`), always use colors in patch.\n \tWhen false (or `never`), never.  When set to `auto`, use\n@@ -155,11 +170,8 @@ color.diff.<slot>::\n \tspecifies which part of the patch to use the specified\n \tcolor, and is one of `plain` (context text), `meta`\n \t(metainformation), `frag` (hunk header), `old` (removed\n-\tlines), or `new` (added lines).  The value for these\n-\tconfiguration variables can be one of: `normal`, `bold`,\n-\t`dim`, `ul`, `blink`, `reverse`, `reset`, `black`,\n-\t`red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, or\n-\t`white`.\n+\tlines), or `new` (added lines).  The values of these\n+\tvariables may be specified as in color.branch.<slot>.\n \n color.pager::\n \tA boolean to enable/disable colored output when the pager is in\n@@ -177,7 +189,7 @@ color.status.<slot>::\n \t`added` or `updated` (files which are added but not committed),\n \t`changed` (files which are changed but not added in the index),\n \tor `untracked` (files which are not tracked by git). The values of\n-\tthese variables may be specified as in color.diff.<slot>.\n+\tthese variables may be specified as in color.branch.<slot>.\n \n diff.renameLimit::\n \tThe number of files to consider when performing the copy/rename\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex c464bd2..e872fc8 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -8,7 +8,7 @@ git-branch - List, create, or delete branches.\n SYNOPSIS\n --------\n [verse]\n-'git-branch' [-r | -a] [-v [--abbrev=<length>]]\n+'git-branch' [--color | --no-color] [-r | -a] [-v [--abbrev=<length>]]\n 'git-branch' [-l] [-f] <branchname> [<start-point>]\n 'git-branch' (-m | -M) [<oldbranch>] <newbranch>\n 'git-branch' (-d | -D) [-r] <branchname>...\n@@ -60,6 +60,13 @@ OPTIONS\n -M::\n \tMove/rename a branch even if the new branchname already exists.\n \n+--color::\n+\tColor branches to highlight current, local, and remote branches.\n+\n+--no-color::\n+\tTurn off branch colors, even when the configuration file gives the\n+\tdefault to color output.\n+\n -r::\n \tList or delete (if used with -d) the remote-tracking branches.\n \ndiff --git a/builtin-branch.c b/builtin-branch.c\nindex 745ee04..1ed0fa9 100644\n--- a/builtin-branch.c\n+++ b/builtin-branch.c\n@@ -12,7 +12,7 @@\n #include \"builtin.h\"\n \n static const char builtin_branch_usage[] =\n-  \"git-branch [-r] (-d | -D) <branchname> | [-l] [-f] <branchname> [<start-point>] | (-m | -M) [<oldbranch>] <newbranch> | [-r | -a] [-v [--abbrev=<length>]]\";\n+  \"git-branch [-r] (-d | -D) <branchname> | [-l] [-f] <branchname> [<start-point>] | (-m | -M) [<oldbranch>] <newbranch> | [--color | --no-color] [-r | -a] [-v [--abbrev=<length>]]\";\n \n #define REF_UNKNOWN_TYPE    0x00\n #define REF_LOCAL_BRANCH    0x01\n-- \n1.5.0.rc0.g825ce\n"}]}