mirror of
https://github.com/git/git.git
synced 2026-01-18 14:44:28 +00:00
Merge branch 'sd/log-decorate' into next
* sd/log-decorate: log.decorate: only ignore it under "log --pretty=raw" script with rev-list instead of log
This commit is contained in:
@@ -110,10 +110,11 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
|
||||
}
|
||||
|
||||
/*
|
||||
* defeat log.decorate configuration interacting with --pretty
|
||||
* defeat log.decorate configuration interacting with --pretty=raw
|
||||
* from the command line.
|
||||
*/
|
||||
if (!decoration_given && rev->pretty_given)
|
||||
if (!decoration_given && rev->pretty_given
|
||||
&& rev->commit_format == CMIT_FMT_RAW)
|
||||
decoration_style = 0;
|
||||
|
||||
if (decoration_style) {
|
||||
|
||||
@@ -57,7 +57,7 @@ create_stash () {
|
||||
# state of the base commit
|
||||
if b_commit=$(git rev-parse --verify HEAD)
|
||||
then
|
||||
head=$(git log --no-color --abbrev-commit --pretty=oneline -n 1 HEAD --)
|
||||
head=$(git rev-list --oneline -n 1 HEAD --)
|
||||
else
|
||||
die "You do not have the initial commit yet"
|
||||
fi
|
||||
|
||||
@@ -648,7 +648,7 @@ cmd_summary() {
|
||||
range=$sha1_dst
|
||||
fi
|
||||
GIT_DIR="$name/.git" \
|
||||
git log --pretty=oneline --first-parent $range | wc -l
|
||||
git rev-list --first-parent $range -- | wc -l
|
||||
)
|
||||
total_commits=" ($(($total_commits + 0)))"
|
||||
;;
|
||||
|
||||
@@ -390,62 +390,50 @@ test_expect_success 'log --graph with merge' '
|
||||
test_expect_success 'log.decorate configuration' '
|
||||
git config --unset-all log.decorate || :
|
||||
|
||||
git log >expect.none &&
|
||||
git log --decorate >expect.short &&
|
||||
git log --decorate=full >expect.full &&
|
||||
git log --oneline >expect.oneline &&
|
||||
git log --oneline >expect.none &&
|
||||
git log --oneline --decorate >expect.short &&
|
||||
git log --oneline --decorate=full >expect.full &&
|
||||
|
||||
echo "[log] decorate" >>.git/config &&
|
||||
git log >actual &&
|
||||
test_cmp expect.short actual &&
|
||||
git log --oneline >actual &&
|
||||
test_cmp expect.oneline actual &&
|
||||
test_cmp expect.short actual &&
|
||||
|
||||
git config --unset-all log.decorate &&
|
||||
git config log.decorate true &&
|
||||
git log >actual &&
|
||||
test_cmp expect.short actual &&
|
||||
git log --decorate=full >actual &&
|
||||
test_cmp expect.full actual &&
|
||||
git log --decorate=no >actual &&
|
||||
test_cmp expect.none actual &&
|
||||
git log --oneline >actual &&
|
||||
test_cmp expect.oneline actual &&
|
||||
test_cmp expect.short actual &&
|
||||
git log --oneline --decorate=full >actual &&
|
||||
test_cmp expect.full actual &&
|
||||
git log --oneline --decorate=no >actual &&
|
||||
test_cmp expect.none actual &&
|
||||
|
||||
git config --unset-all log.decorate &&
|
||||
git config log.decorate no &&
|
||||
git log >actual &&
|
||||
test_cmp expect.none actual &&
|
||||
git log --decorate >actual &&
|
||||
test_cmp expect.short actual &&
|
||||
git log --decorate=full >actual &&
|
||||
test_cmp expect.full actual &&
|
||||
git log --oneline >actual &&
|
||||
test_cmp expect.oneline actual &&
|
||||
test_cmp expect.none actual &&
|
||||
git log --oneline --decorate >actual &&
|
||||
test_cmp expect.short actual &&
|
||||
git log --oneline --decorate=full >actual &&
|
||||
test_cmp expect.full actual &&
|
||||
|
||||
git config --unset-all log.decorate &&
|
||||
git config log.decorate short &&
|
||||
git log >actual &&
|
||||
test_cmp expect.short actual &&
|
||||
git log --no-decorate >actual &&
|
||||
test_cmp expect.none actual &&
|
||||
git log --decorate=full >actual &&
|
||||
test_cmp expect.full actual &&
|
||||
git log --oneline >actual &&
|
||||
test_cmp expect.oneline actual &&
|
||||
test_cmp expect.short actual &&
|
||||
git log --oneline --no-decorate >actual &&
|
||||
test_cmp expect.none actual &&
|
||||
git log --oneline --decorate=full >actual &&
|
||||
test_cmp expect.full actual &&
|
||||
|
||||
git config --unset-all log.decorate &&
|
||||
git config log.decorate full &&
|
||||
git log >actual &&
|
||||
test_cmp expect.full actual &&
|
||||
git log --no-decorate >actual &&
|
||||
test_cmp expect.none actual &&
|
||||
git log --decorate >actual &&
|
||||
test_cmp expect.short actual
|
||||
git log --oneline >actual &&
|
||||
test_cmp expect.oneline actual &&
|
||||
test_cmp expect.full actual &&
|
||||
git log --oneline --no-decorate >actual &&
|
||||
test_cmp expect.none actual &&
|
||||
git log --oneline --decorate >actual &&
|
||||
test_cmp expect.short actual
|
||||
|
||||
:
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
Reference in New Issue
Block a user