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

[PATCH 1/4] line-log: demonstrate a bug with nearly-overlapping ranges

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 4, 2018, 22:18 UTC
Message-ID
<cab7bb36eb85dbe38ad95ee02b083f11f0820e24.1533421100.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.15.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Currently, this test case throws an assertion:
	Assertion failed!
	Program: git.exe
	File: line-log.c, Line 71
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t4211-line-log.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index 436b13ad2..61ff37430 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -115,4 +115,21 @@ test_expect_success 'range_set_union' '
 	git log $(for x in $(test_seq 200); do echo -L $((2*x)),+1:c.c; done)
 '
 
+q_to_lf () {
+	tr Q '\012'
+}
+
+test_expect_failure 'close to overlapping ranges' '
+	test_seq 5 >a1.c &&
+	git add a1.c &&
+	git commit -m "5 lines" a1.c &&
+	sed s/3/3QaQb/ <a1.c | q_to_lf >tmp &&
+	mv tmp a1.c &&
+	git commit -m "2 more lines" a1.c &&
+	sed s/4/cQ4/ <a1.c | q_to_lf >tmp &&
+	mv tmp a1.c &&
+	git commit -m "1 more line" a1.c &&
+	git --no-pager log -L 1,3:a1.c -L 5,8:a1.c
+'
+
 test_done
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Jonathan Nieder
Message 2 of 20 in “line-log: be more careful when adjusting multiple line ranges”
  1. 0/4 line-log: be more careful when adjusting multiple line rangesJohannes Schindelin via GitGitGadget, Aug 4, 2018
  2. 1/4 line-log: demonstrate a bug with nearly-overlapping rangesJohannes Schindelin via GitGitGadget, Aug 4, 2018
  3. Jonathan NiederAug 5, 2018
  4. Johannes SchindelinAug 6, 2018
  5. Jonathan NiederAug 6, 2018
  6. Jonathan NiederAug 6, 2018
  7. 2/4 line-log: adjust start/end of ranges individuallyJohannes Schindelin via GitGitGadget, Aug 4, 2018
  8. Eric SunshineAug 5, 2018
  9. Eric SunshineAug 5, 2018
  10. Johannes SchindelinAug 6, 2018
  11. 3/4 line-log: optimize ranges by joining them when possibleJohannes Schindelin via GitGitGadget, Aug 4, 2018
  12. Junio C HamanoAug 5, 2018
  13. Andrei RybakAug 5, 2018
  14. Eric SunshineAug 5, 2018
  15. 4/4 line-log: convert an assertion to a full BUG() callJohannes Schindelin via GitGitGadget, Aug 4, 2018
  16. Eric SunshineAug 5, 2018
  17. Johannes SchindelinAug 6, 2018
  18. Eric SunshineAug 7, 2018
  19. Eric SunshineAug 7, 2018
  20. Eric SunshineAug 5, 2018

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.