summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-08-20 12:53:09 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-08-20 12:53:09 -0700
commit316fa401e1c953ffc80533aaf6839817595cdd77 (patch)
tree6ad48c40abadde6c9c7d44a9d03246da65f94f25
parentMerge branch 'vs/doc-spell' into maint (diff)
parentexamples/commit: use --abbrev for commit summary (diff)
downloadtgif-316fa401e1c953ffc80533aaf6839817595cdd77.tar.xz
Merge branch 'jn/fix-abbrev' into maint
* jn/fix-abbrev: examples/commit: use --abbrev for commit summary checkout, commit: remove confusing assignments to rev.abbrev archive: abbreviate substituted commit ids again
-rw-r--r--archive.c1
-rw-r--r--builtin/checkout.c1
-rw-r--r--builtin/commit.c1
-rwxr-xr-xcontrib/examples/git-commit.sh2
-rwxr-xr-xt/t5001-archive-attr.sh2
5 files changed, 3 insertions, 4 deletions
diff --git a/archive.c b/archive.c
index d700af3b62..edd68534fa 100644
--- a/archive.c
+++ b/archive.c
@@ -33,6 +33,7 @@ static void format_subst(const struct commit *commit,
struct strbuf fmt = STRBUF_INIT;
struct pretty_print_context ctx = {0};
ctx.date_mode = DATE_NORMAL;
+ ctx.abbrev = DEFAULT_ABBREV;
if (src == buf->buf)
to_free = strbuf_detach(buf, NULL);
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 1994be92c6..eef2b48d98 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -279,7 +279,6 @@ static void show_local_changes(struct object *head)
struct rev_info rev;
/* I think we want full paths, even if we're in a subdirectory. */
init_revisions(&rev, NULL);
- rev.abbrev = 0;
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
if (diff_setup_done(&rev.diffopt) < 0)
die("diff_setup_done failed");
diff --git a/builtin/commit.c b/builtin/commit.c
index 2bb30c0e80..c4a577d5c5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1163,7 +1163,6 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
init_revisions(&rev, prefix);
setup_revisions(0, NULL, &rev, NULL);
- rev.abbrev = 0;
rev.diff = 1;
rev.diffopt.output_format =
DIFF_FORMAT_SHORTSTAT | DIFF_FORMAT_SUMMARY;
diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh
index 5c72f655c7..23ffb028d1 100755
--- a/contrib/examples/git-commit.sh
+++ b/contrib/examples/git-commit.sh
@@ -631,7 +631,7 @@ then
if test -z "$quiet"
then
commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
- --summary --root HEAD --`
+ --abbrev --summary --root HEAD --`
echo "Created${initial_commit:+ initial} commit $commit"
fi
fi
diff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh
index 426b319bd3..02d4d2284d 100755
--- a/t/t5001-archive-attr.sh
+++ b/t/t5001-archive-attr.sh
@@ -4,7 +4,7 @@ test_description='git archive attribute tests'
. ./test-lib.sh
-SUBSTFORMAT=%H%n
+SUBSTFORMAT='%H (%h)%n'
test_expect_exists() {
test_expect_success " $1 exists" "test -e $1"