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
This commit is contained in:
commit
316fa401e1
@ -33,6 +33,7 @@ static void format_subst(const struct commit *commit,
|
|||||||
struct strbuf fmt = STRBUF_INIT;
|
struct strbuf fmt = STRBUF_INIT;
|
||||||
struct pretty_print_context ctx = {0};
|
struct pretty_print_context ctx = {0};
|
||||||
ctx.date_mode = DATE_NORMAL;
|
ctx.date_mode = DATE_NORMAL;
|
||||||
|
ctx.abbrev = DEFAULT_ABBREV;
|
||||||
|
|
||||||
if (src == buf->buf)
|
if (src == buf->buf)
|
||||||
to_free = strbuf_detach(buf, NULL);
|
to_free = strbuf_detach(buf, NULL);
|
||||||
|
@ -279,7 +279,6 @@ static void show_local_changes(struct object *head)
|
|||||||
struct rev_info rev;
|
struct rev_info rev;
|
||||||
/* I think we want full paths, even if we're in a subdirectory. */
|
/* I think we want full paths, even if we're in a subdirectory. */
|
||||||
init_revisions(&rev, NULL);
|
init_revisions(&rev, NULL);
|
||||||
rev.abbrev = 0;
|
|
||||||
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
|
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
|
||||||
if (diff_setup_done(&rev.diffopt) < 0)
|
if (diff_setup_done(&rev.diffopt) < 0)
|
||||||
die("diff_setup_done failed");
|
die("diff_setup_done failed");
|
||||||
|
@ -1163,7 +1163,6 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
|
|||||||
init_revisions(&rev, prefix);
|
init_revisions(&rev, prefix);
|
||||||
setup_revisions(0, NULL, &rev, NULL);
|
setup_revisions(0, NULL, &rev, NULL);
|
||||||
|
|
||||||
rev.abbrev = 0;
|
|
||||||
rev.diff = 1;
|
rev.diff = 1;
|
||||||
rev.diffopt.output_format =
|
rev.diffopt.output_format =
|
||||||
DIFF_FORMAT_SHORTSTAT | DIFF_FORMAT_SUMMARY;
|
DIFF_FORMAT_SHORTSTAT | DIFF_FORMAT_SUMMARY;
|
||||||
|
@ -631,7 +631,7 @@ then
|
|||||||
if test -z "$quiet"
|
if test -z "$quiet"
|
||||||
then
|
then
|
||||||
commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
|
commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
|
||||||
--summary --root HEAD --`
|
--abbrev --summary --root HEAD --`
|
||||||
echo "Created${initial_commit:+ initial} commit $commit"
|
echo "Created${initial_commit:+ initial} commit $commit"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -4,7 +4,7 @@ test_description='git archive attribute tests'
|
|||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
SUBSTFORMAT=%H%n
|
SUBSTFORMAT='%H (%h)%n'
|
||||||
|
|
||||||
test_expect_exists() {
|
test_expect_exists() {
|
||||||
test_expect_success " $1 exists" "test -e $1"
|
test_expect_success " $1 exists" "test -e $1"
|
||||||
|
Loading…
Reference in New Issue
Block a user