summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 76c82f9)
raw | patch | inline | side by side (parent: 76c82f9)
author | Namhyung Kim <namhyung@gmail.com> | |
Fri, 1 Jul 2011 06:06:08 +0000 (15:06 +0900) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 1 Jul 2011 18:22:09 +0000 (11:22 -0700) |
Use the value from 'core.abbrev' configuration variable unless user
specifies the length on command line when showing commit object name
in "branch -v" output.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
specifies the length on command line when showing commit object name
in "branch -v" output.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-branch.txt | patch | blob | history | |
builtin/branch.c | patch | blob | history |
index c50f1898272f6b2a9a1c1cd236d3b27621d4fdb9..507b8d0ab2a2d524a607c5b91e6d17f6d2f36392 100644 (file)
--abbrev=<length>::
Alter the sha1's minimum display length in the output listing.
- The default value is 7.
+ The default value is 7 and can be overridden by the `core.abbrev`
+ config option.
--no-abbrev::
Display the full sha1s in the output listing rather than abbreviating them.
diff --git a/builtin/branch.c b/builtin/branch.c
index 3142daa57a6fa1c8a7d21095946bf5d26443d0e0..953bc1ca9bca583072d36a0dbd904eaa2afa89c8 100644 (file)
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -613,7 +613,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int
int cmd_branch(int argc, const char **argv, const char *prefix)
{
int delete = 0, rename = 0, force_create = 0;
- int verbose = 0, abbrev = DEFAULT_ABBREV, detached = 0;
+ int verbose = 0, abbrev = -1, detached = 0;
int reflog = 0;
enum branch_track track;
int kinds = REF_LOCAL_BRANCH;
if (!!delete + !!rename + !!force_create > 1)
usage_with_options(builtin_branch_usage, options);
+ if (abbrev == -1)
+ abbrev = DEFAULT_ABBREV;
+
if (delete)
return delete_branches(argc, argv, delete > 1, kinds);
else if (argc == 0)