From: Koosha Khajehmoogahi <koosha@posteo.de>
To: git@vger.kernel.org
Subject: [PATCH v3 4/5] t4202-log: add tests for --merges=
Date: Mon, 13 Apr 2015 17:29:27 +0200 [thread overview]
Message-ID: <1428938968-19013-4-git-send-email-koosha@posteo.de> (raw)
In-Reply-To: <1428938968-19013-1-git-send-email-koosha@posteo.de>
From: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Koosha Khajehmoogahi <koosha@posteo.de>
---
t/t4202-log.sh | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 1b2e981..3edcd81 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -270,6 +270,35 @@ cat > expect <<\EOF
* initial
EOF
+test_expect_success 'setup merges=' '
+ git log --min-parents=2 --pretty=tformat:%s >expect_only &&
+ git log --max-parents=1 --pretty=tformat:%s >expect_hide &&
+ git log --min-parents=-1 --pretty=tformat:%s >expect_show
+'
+
+test_log_merges() {
+ expect=expect_$1
+ config=${2:+-c log.merges=$2}
+ option=${3:+--merges=$3}
+ option=${4:-$option}
+ test_expect_success "merges${config:+ $config}${option:+ $option}" "
+ git $config log $option --pretty=tformat:%s >actual &&
+ test_cmp $expect actual
+ "
+}
+
+states="show only hide"
+for c in '' $states
+do
+ for o in '' $states
+ do
+ test_log_merges ${o:-${c:-show}} "$c" "$o"
+ done
+done
+
+test_log_merges hide show '' --no-merges
+test_log_merges only hide '' '--merges --max-parents=2'
+
test_expect_success 'log --graph with merge' '
git log --graph --date-order --pretty=tformat:%s |
sed "s/ *\$//" >actual &&
--
2.3.3.263.g095251d.dirty
next prev parent reply other threads:[~2015-04-13 15:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 15:29 [PATCH v3 1/5] revision: add --merges={show|only|hide} option Koosha Khajehmoogahi
2015-04-13 15:29 ` [PATCH v3 2/5] log: honor log.merges= option Koosha Khajehmoogahi
2015-04-16 6:07 ` Junio C Hamano
2015-04-13 15:29 ` [PATCH v3 3/5] Documentation: add git-log --merges= option and log.merges config. var Koosha Khajehmoogahi
2015-04-14 6:42 ` Eric Sunshine
2015-04-15 22:27 ` Koosha Khajehmoogahi
2015-04-16 4:49 ` Eric Sunshine
2015-04-13 15:29 ` Koosha Khajehmoogahi [this message]
2015-04-14 6:52 ` [PATCH v3 4/5] t4202-log: add tests for --merges= Eric Sunshine
2015-04-13 15:29 ` [PATCH v3 5/5] bash-completion: add support for git-log --merges= and log.merges Koosha Khajehmoogahi
2015-04-21 12:51 ` [PATCH] squash! " SZEDER Gábor
2015-04-21 17:42 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428938968-19013-4-git-send-email-koosha@posteo.de \
--to=koosha@posteo.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).