{"thread":{"id":"61409","subject":"[bug report] `git log` with several `-L` might produce error","startedAt":"2024-05-02T18:29:16Z","lastAt":"2024-05-02T18:29:16Z","messageCount":1,"participants":["Evgeni Chasnovski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"493933","messageId":"CAP9Eqm1PsYBdjoVKgomJZe79_ZCOAtP4p7uvprUOerdjrcUjmQ@mail.gmail.com","threadId":"61409","inReplyTo":null,"subject":"[bug report] `git log` with several `-L` might produce error","fromName":"Evgeni Chasnovski","fromEmail":"evgeni.chasnovski@gmail.com","sentAt":"2024-05-02T18:29:04Z","receivedAt":"2024-05-02T18:29:16Z","isPatch":false,"sender":{"key":"evgeni.chasnovski@gmail.com","avatar":null},"body":"This is a bug report as per https://git-scm.com/community\n\n# What did you do before the bug happened? (Steps to reproduce your issue)\n\nCalling `git log` with several `-L` flags can result in an error.\n\nSteps to reproduce (on Linux):\n- Set up repo with a history:\n    - `mkdir log-line-assert`\n    - `cd log-line-assert`\n    - `git init`\n    - `echo \"Line 1\\nLine 2\" > file`\n    - `git add .`\n    - `git commit -m 'Commit 1'`\n    - `echo \"Line 3\\nLine 4\\nLine 5\" >> file`\n    - `git add .`\n    - `git commit -m 'Commit 2'`\n- Execute the following command: `git log -L2,2:file -L4,4:file`\n\n# What did you expect to happen? (Expected behavior)\n\nShow log with evolution of lines 2 and 4.\n\n# What happened instead? (Actual behavior)\n\nAn error with the following text:\n\n```\ngit: line-log.c:73: range_set_append: Assertion `rs->nr == 0 ||\nrs->ranges[rs->nr-1].end <= a' failed.\nzsh: IOT instruction (core dumped)  git log -L2,2:file -L4,4:file\n```\n\n# What's different between what you expected and what actually happened?\n\nAn error for what looks like a valid command (as some other similar\ncommands work as expected, like `git log -L2,2:file -L3,3:file` or\n`git log -L1,1:file -L4,4:file`).\n\n# Anything else you want to add:\n\n-\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.44.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.8.7-arch1-2 #1 SMP PREEMPT_DYNAMIC Fri, 19 Apr 2024\n09:51:31 +0000 x86_64\ncompiler info: gnuc: 13.2\nlibc info: glibc: 2.39\n$SHELL (typically, interactive shell): /usr/bin/zsh\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"}]}