Skip to content

Commit 316fa40

Browse files
committed
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
2 parents 7d61b31 + 7f1592d commit 316fa40

File tree

5 files changed

+3
-4
lines changed

5 files changed

+3
-4
lines changed

archive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ static void format_subst(const struct commit *commit,
3333
struct strbuf fmt = STRBUF_INIT;
3434
struct pretty_print_context ctx = {0};
3535
ctx.date_mode = DATE_NORMAL;
36+
ctx.abbrev = DEFAULT_ABBREV;
3637

3738
if (src == buf->buf)
3839
to_free = strbuf_detach(buf, NULL);

builtin/checkout.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ static void show_local_changes(struct object *head)
279279
struct rev_info rev;
280280
/* I think we want full paths, even if we're in a subdirectory. */
281281
init_revisions(&rev, NULL);
282-
rev.abbrev = 0;
283282
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
284283
if (diff_setup_done(&rev.diffopt) < 0)
285284
die("diff_setup_done failed");

builtin/commit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,6 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
11631163
init_revisions(&rev, prefix);
11641164
setup_revisions(0, NULL, &rev, NULL);
11651165

1166-
rev.abbrev = 0;
11671166
rev.diff = 1;
11681167
rev.diffopt.output_format =
11691168
DIFF_FORMAT_SHORTSTAT | DIFF_FORMAT_SUMMARY;

contrib/examples/git-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ then
631631
if test -z "$quiet"
632632
then
633633
commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
634-
--summary --root HEAD --`
634+
--abbrev --summary --root HEAD --`
635635
echo "Created${initial_commit:+ initial} commit $commit"
636636
fi
637637
fi

t/t5001-archive-attr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_description='git archive attribute tests'
44

55
. ./test-lib.sh
66

7-
SUBSTFORMAT=%H%n
7+
SUBSTFORMAT='%H (%h)%n'
88

99
test_expect_exists() {
1010
test_expect_success " $1 exists" "test -e $1"

0 commit comments

Comments
 (0)