git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 4/5] t4202-log: add tests for --merges=

From
KKKoosha Khajehmoogahi <koosha@posteo.de>
Date
Apr 4, 2015, 01:22 UTC
Message-ID
<1428110521-31028-4-git-send-email-koosha@posteo.de>
In-Reply-To
<1428110521-31028-1-git-send-email-koosha@posteo.de>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Koosha Khajehmoogahi <koosha@posteo.de>
---
 t/t4202-log.sh | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 1b2e981..ceaaf4e 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -270,6 +270,90 @@ 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_expect_success 'log with config log.merges=show' '
+	test_config log.merges show &&
+	git log --pretty=tformat:%s >actual &&
+	test_cmp expect_show actual
+'
+
+test_expect_success 'log with config log.merges=only' '
+	test_config log.merges only &&
+	git log --pretty=tformat:%s >actual &&
+	test_cmp expect_only actual
+'
+
+test_expect_success 'log with config log.merges=hide' '
+	test_config log.merges hide &&
+	git log --pretty=tformat:%s >actual &&
+	test_cmp expect_hide actual
+'
+
+test_expect_success 'log with config log.merges=show with git log --no-merges' '
+	test_config log.merges show &&
+	git log --no-merges --pretty=tformat:%s >actual &&
+	test_cmp expect_hide actual
+'
+
+test_expect_success 'log with config log.merges=hide with git log ---merges' '
+	test_config log.merges hide &&
+	git log --merges --pretty=tformat:%s >actual &&
+	test ! -s actual
+'
+
+test_expect_success 'log --merges=show' '
+	test_unconfig log.merges &&
+	git log --merges=show --pretty=tformat:%s >actual &&
+	test_cmp expect_show actual
+'
+
+test_expect_success 'log --merges=only' '
+	test_unconfig log.merges &&
+	git log --merges=only --pretty=tformat:%s >actual &&
+	test_cmp expect_only actual
+'
+
+test_expect_success 'log --merges=hide' '
+	test_unconfig log.merges &&
+	git log --merges=hide --pretty=tformat:%s >actual &&
+	test_cmp expect_hide actual
+'
+
+test_log_merges() {
+	test_config log.merges $2 &&
+	git log --merges=$1 --pretty=tformat:%s >actual &&
+	test_cmp $3 actual
+}
+
+test_expect_success 'log --merges=show with config log.merges=hide' '
+	test_log_merges show hide expect_show
+'
+
+test_expect_success 'log --merges=show with config log.merges=only' '
+	test_log_merges show only expect_show
+'
+
+test_expect_success 'log --merges=only with config log.merges=show' '
+	test_log_merges only show expect_only
+'
+
+test_expect_success 'log --merges=only with config log.merges=hide' '
+	test_log_merges only hide expect_only
+'
+
+test_expect_success 'log --merges=hide with config log.merges=show' '
+	test_log_merges hide show expect_hide
+'
+
+test_expect_success 'log --merges=hide with config log.merges=only' '
+	test_log_merges hide only expect_hide
+'
+
 test_expect_success 'log --graph with merge' '
 	git log --graph --date-order --pretty=tformat:%s |
 		sed "s/ *\$//" >actual &&
-- 
2.3.3.263.g095251d.dirty
Previous: Junio C HamanoNext: Eric Sunshine
Message 11 of 14 in “revision: add --merges={show|only|hide} option”
  1. 1/5 revision: add --merges={show|only|hide} optionKoosha Khajehmoogahi, Apr 4, 2015
  2. 2/5 log: honor log.merges= optionKoosha Khajehmoogahi, Apr 4, 2015
  3. Junio C HamanoApr 4, 2015
  4. Koosha KhajehmoogahiApr 7, 2015
  5. Junio C HamanoApr 8, 2015
  6. Koosha KhajehmoogahiApr 8, 2015
  7. Junio C HamanoApr 13, 2015
  8. Eric SunshineApr 7, 2015
  9. 3/5 Documentation: add git-log --merges= option and log.merges config. varKoosha Khajehmoogahi, Apr 4, 2015
  10. Junio C HamanoApr 5, 2015
  11. 4/5 t4202-log: add tests for --merges=Koosha Khajehmoogahi, Apr 4, 2015
  12. Eric SunshineApr 7, 2015
  13. 5/5 bash-completion: add support for git-log --merges= and log.mergesKoosha Khajehmoogahi, Apr 4, 2015
  14. Eric SunshineApr 7, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.