{"thread":{"id":"51958","subject":"[PATCH 0/1] Avoid segmentation fault in git range-diff when diff.noprefix=true","startedAt":"2019-10-02T18:05:16Z","lastAt":"2019-10-03T02:11:25Z","messageCount":11,"participants":["Johannes Schindelin via GitGitGadget","Eric Sunshine","Michal Suchánek","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"383289","messageId":"pull.373.git.gitgitgadget@gmail.com","threadId":"51958","inReplyTo":null,"subject":"[PATCH 0/1] Avoid segmentation fault in git range-diff when diff.noprefix=true","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-10-02T18:05:12Z","receivedAt":"2019-10-02T18:05:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This PR was inspired by this bug report: \nhttps://public-inbox.org/git/20191002141615.GB17916@kitsune.suse.cz/T/#me576615d7a151cf2ed46186c482fbd88f9959914\n\nJohannes Schindelin (1):\n  range-diff: internally force `diff.noprefix=false`\n\n range-diff.c          | 3 ++-\n t/t3206-range-diff.sh | 4 ++++\n 2 files changed, 6 insertions(+), 1 deletion(-)\n\n\nbase-commit: bc12974a897308fd3254cf0cc90319078fe45eea\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-373%2Fdscho%2Frange-diff-requires-diff-prefix-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-373/dscho/range-diff-requires-diff-prefix-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/373\n-- \ngitgitgadget\n"},{"id":"383290","messageId":"1f84f92846bc14d21aa7339c8baa0f9bb710b17d.1570039511.git.gitgitgadget@gmail.com","threadId":"51958","inReplyTo":"pull.373.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] range-diff: internally force `diff.noprefix=false`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-10-02T18:05:13Z","receivedAt":"2019-10-02T18:05:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWhen parsing the diffs, `range-diff` expects to see the prefixes `a/`\nand `b/` in the diff headers.\n\nThese prefixes can be forced off via the config setting\n`diff.noprefix=true`. As `range-diff` is not prepared for that\nsituation, this will cause a segmentation fault.\n\nLet's avoid that by forcing `diff.noprefix=false` just for that all to\n`git log` that generates the diffs that `range-diff` wants to parse.\n\nNoticed-by: Michal Suchánek <msuchanek@suse.de>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n range-diff.c          | 3 ++-\n t/t3206-range-diff.sh | 4 ++++\n 2 files changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/range-diff.c b/range-diff.c\nindex ba1e9a4265..8cc348b4cb 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -50,7 +50,8 @@ static int read_patches(const char *range, struct string_list *list)\n \tint offset, len;\n \tsize_t size;\n \n-\targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n+\targv_array_pushl(&cp.args, \"-c\", \"diff.noprefix=false\",\n+\t\t\t\"log\", \"--no-color\", \"-p\", \"--no-merges\",\n \t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n \t\t\t/*\n \t\t\t * Choose indicators that are not used anywhere\ndiff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh\nindex 0120f769f1..64b66f2094 100755\n--- a/t/t3206-range-diff.sh\n+++ b/t/t3206-range-diff.sh\n@@ -461,4 +461,8 @@ test_expect_success 'format-patch --range-diff as commentary' '\n \tgrep \"> 1: .* new message\" 0001-*\n '\n \n+test_expect_success 'range-diff overrides diff.noprefix internally' '\n+\tgit -c diff.noprefix=true range-diff HEAD^...\n+'\n+\n test_done\n-- \ngitgitgadget\n"},{"id":"383291","messageId":"CAPig+cS1XHLC3Q_Ntq=-Ck8WzRR7FL1qwQuCfUPVFSTkEKK+LQ@mail.gmail.com","threadId":"51958","inReplyTo":"1f84f92846bc14d21aa7339c8baa0f9bb710b17d.1570039511.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] range-diff: internally force `diff.noprefix=false`","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-10-02T18:34:29Z","receivedAt":"2019-10-02T18:34:45Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Oct 2, 2019 at 2:05 PM Johannes Schindelin via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n> When parsing the diffs, `range-diff` expects to see the prefixes `a/`\n> and `b/` in the diff headers.\n>\n> These prefixes can be forced off via the config setting\n> `diff.noprefix=true`. As `range-diff` is not prepared for that\n> situation, this will cause a segmentation fault.\n>\n> Let's avoid that by forcing `diff.noprefix=false` just for that all to\n\ns/all/call/\n\n> `git log` that generates the diffs that `range-diff` wants to parse.\n>\n> Noticed-by: Michal Suchánek <msuchanek@suse.de>\n\ns/Noticed/Reported/ perhaps?\n\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n"},{"id":"383296","messageId":"20191002195646.GF17916@kitsune.suse.cz","threadId":"51958","inReplyTo":"1f84f92846bc14d21aa7339c8baa0f9bb710b17d.1570039511.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] range-diff: internally force `diff.noprefix=false`","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2019-10-02T19:56:46Z","receivedAt":"2019-10-02T19:56:51Z","isPatch":true,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Wed, Oct 02, 2019 at 11:05:13AM -0700, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> When parsing the diffs, `range-diff` expects to see the prefixes `a/`\n> and `b/` in the diff headers.\n> \n> These prefixes can be forced off via the config setting\n> `diff.noprefix=true`. As `range-diff` is not prepared for that\n> situation, this will cause a segmentation fault.\n> \n> Let's avoid that by forcing `diff.noprefix=false` just for that all to\n> `git log` that generates the diffs that `range-diff` wants to parse.\n> \n> Noticed-by: Michal Suchánek <msuchanek@suse.de>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nTested-by: Michal Suchánek <msuchanek@suse.de>\n\nThanks\n\nMichal\n> ---\n>  range-diff.c          | 3 ++-\n>  t/t3206-range-diff.sh | 4 ++++\n>  2 files changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/range-diff.c b/range-diff.c\n> index ba1e9a4265..8cc348b4cb 100644\n> --- a/range-diff.c\n> +++ b/range-diff.c\n> @@ -50,7 +50,8 @@ static int read_patches(const char *range, struct string_list *list)\n>  \tint offset, len;\n>  \tsize_t size;\n>  \n> -\targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n> +\targv_array_pushl(&cp.args, \"-c\", \"diff.noprefix=false\",\n> +\t\t\t\"log\", \"--no-color\", \"-p\", \"--no-merges\",\n>  \t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n>  \t\t\t/*\n>  \t\t\t * Choose indicators that are not used anywhere\n> diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh\n> index 0120f769f1..64b66f2094 100755\n> --- a/t/t3206-range-diff.sh\n> +++ b/t/t3206-range-diff.sh\n> @@ -461,4 +461,8 @@ test_expect_success 'format-patch --range-diff as commentary' '\n>  \tgrep \"> 1: .* new message\" 0001-*\n>  '\n>  \n> +test_expect_success 'range-diff overrides diff.noprefix internally' '\n> +\tgit -c diff.noprefix=true range-diff HEAD^...\n> +'\n> +\n>  test_done\n> -- \n> gitgitgadget\n"},{"id":"383299","messageId":"xmqq4l0qewu5.fsf@gitster-ct.c.googlers.com","threadId":"51958","inReplyTo":"1f84f92846bc14d21aa7339c8baa0f9bb710b17d.1570039511.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] range-diff: internally force `diff.noprefix=false`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-02T20:06:26Z","receivedAt":"2019-10-02T20:06:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> When parsing the diffs, `range-diff` expects to see the prefixes `a/`\n> and `b/` in the diff headers.\n\nIf so, passing src/dst prefix as command line option is a much\nbetter solution, I think.  diff.noprefix may not stay to be (or it\nmay already not to be) the only thing how the prefix gets chosen.\n\n> -\targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n> +\targv_array_pushl(&cp.args, \"-c\", \"diff.noprefix=false\",\n> +\t\t\t\"log\", \"--no-color\", \"-p\", \"--no-merges\",\n>  \t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n>  \t\t\t/*\n>  \t\t\t * Choose indicators that are not used anywhere\n> diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh\n> index 0120f769f1..64b66f2094 100755\n> --- a/t/t3206-range-diff.sh\n> +++ b/t/t3206-range-diff.sh\n> @@ -461,4 +461,8 @@ test_expect_success 'format-patch --range-diff as commentary' '\n>  \tgrep \"> 1: .* new message\" 0001-*\n>  '\n>  \n> +test_expect_success 'range-diff overrides diff.noprefix internally' '\n> +\tgit -c diff.noprefix=true range-diff HEAD^...\n> +'\n> +\n>  test_done\n"},{"id":"383303","messageId":"nycvar.QRO.7.76.6.1910022229340.46@tvgsbejvaqbjf.bet","threadId":"51958","inReplyTo":"xmqq4l0qewu5.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] range-diff: internally force `diff.noprefix=false`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-10-02T20:30:26Z","receivedAt":"2019-10-02T20:31:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Thu, 3 Oct 2019, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > When parsing the diffs, `range-diff` expects to see the prefixes `a/`\n> > and `b/` in the diff headers.\n>\n> If so, passing src/dst prefix as command line option is a much better\n> solution, I think.  diff.noprefix may not stay to be (or it may\n> already not to be) the only thing how the prefix gets chosen.\n\nGood point.\n\nWhile at it, I invert the logic in v2: instead of forcing a prefix, I\nnow force no prefix (and reduce the strip level from 1 to 0 when parsing\nthe diff header).\n\nThanks,\nDscho\n\n>\n> > -\targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n> > +\targv_array_pushl(&cp.args, \"-c\", \"diff.noprefix=false\",\n> > +\t\t\t\"log\", \"--no-color\", \"-p\", \"--no-merges\",\n> >  \t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n> >  \t\t\t/*\n> >  \t\t\t * Choose indicators that are not used anywhere\n> > diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh\n> > index 0120f769f1..64b66f2094 100755\n> > --- a/t/t3206-range-diff.sh\n> > +++ b/t/t3206-range-diff.sh\n> > @@ -461,4 +461,8 @@ test_expect_success 'format-patch --range-diff as commentary' '\n> >  \tgrep \"> 1: .* new message\" 0001-*\n> >  '\n> >\n> > +test_expect_success 'range-diff overrides diff.noprefix internally' '\n> > +\tgit -c diff.noprefix=true range-diff HEAD^...\n> > +'\n> > +\n> >  test_done\n>\n"},{"id":"383306","messageId":"pull.373.v2.git.gitgitgadget@gmail.com","threadId":"51958","inReplyTo":"pull.373.git.gitgitgadget@gmail.com","subject":"[PATCH v2 0/1] Avoid segmentation fault in git range-diff when diff.noprefix=true","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-10-02T21:10:46Z","receivedAt":"2019-10-02T21:10:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This PR was inspired by this bug report: \nhttps://public-inbox.org/git/20191002141615.GB17916@kitsune.suse.cz/T/#me576615d7a151cf2ed46186c482fbd88f9959914\n\nChanges since v1:\n\n * Use a command-line option instead of a command-line config setting.\n * Instead of forcing a prefix, force no prefix (and adjust the strip\n   level).\n * Fix typo \"all\" -> \"call\" in the commit message (and adjust it to reflect\n   the other changes since v1, too).\n\nJohannes Schindelin (1):\n  range-diff: internally force `diff.noprefix=true`\n\n range-diff.c          | 3 ++-\n t/t3206-range-diff.sh | 4 ++++\n 2 files changed, 6 insertions(+), 1 deletion(-)\n\n\nbase-commit: bc12974a897308fd3254cf0cc90319078fe45eea\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-373%2Fdscho%2Frange-diff-requires-diff-prefix-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-373/dscho/range-diff-requires-diff-prefix-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/373\n\nRange-diff vs v1:\n\n 1:  1f84f92846 ! 1:  9993a607be range-diff: internally force `diff.noprefix=false`\n     @@ -1,6 +1,6 @@\n      Author: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n     -    range-diff: internally force `diff.noprefix=false`\n     +    range-diff: internally force `diff.noprefix=true`\n      \n          When parsing the diffs, `range-diff` expects to see the prefixes `a/`\n          and `b/` in the diff headers.\n     @@ -9,25 +9,33 @@\n          `diff.noprefix=true`. As `range-diff` is not prepared for that\n          situation, this will cause a segmentation fault.\n      \n     -    Let's avoid that by forcing `diff.noprefix=false` just for that all to\n     -    `git log` that generates the diffs that `range-diff` wants to parse.\n     +    Let's avoid that by passing the `--no-prefix` option to the `git log`\n     +    process that generates the diffs that `range-diff` wants to parse.\n     +    And of course expect the output to have no prefixes, then.\n      \n     -    Noticed-by: Michal Suchánek <msuchanek@suse.de>\n     +    Reported-by: Michal Suchánek <msuchanek@suse.de>\n          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n       diff --git a/range-diff.c b/range-diff.c\n       --- a/range-diff.c\n       +++ b/range-diff.c\n      @@\n     - \tint offset, len;\n     - \tsize_t size;\n       \n     --\targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n     -+\targv_array_pushl(&cp.args, \"-c\", \"diff.noprefix=false\",\n     -+\t\t\t\"log\", \"--no-color\", \"-p\", \"--no-merges\",\n     + \targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n       \t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n     ++\t\t\t\"--no-prefix\",\n       \t\t\t/*\n       \t\t\t * Choose indicators that are not used anywhere\n     + \t\t\t * else in diffs, but still look reasonable\n     +@@\n     + \t\t\tif (!util->diff_offset)\n     + \t\t\t\tutil->diff_offset = buf.len;\n     + \t\t\tline[len - 1] = '\\n';\n     +-\t\t\tlen = parse_git_diff_header(&root, &linenr, 1, line,\n     ++\t\t\tlen = parse_git_diff_header(&root, &linenr, 0, line,\n     + \t\t\t\t\t\t    len, size, &patch);\n     + \t\t\tif (len < 0)\n     + \t\t\t\tdie(_(\"could not parse git header '%.*s'\"), (int)len, line);\n      \n       diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh\n       --- a/t/t3206-range-diff.sh\n\n-- \ngitgitgadget\n"},{"id":"383307","messageId":"9993a607beaafc66f72e1be3f158074cd121b4bb.1570050645.git.gitgitgadget@gmail.com","threadId":"51958","inReplyTo":"pull.373.v2.git.gitgitgadget@gmail.com","subject":"[PATCH v2 1/1] range-diff: internally force `diff.noprefix=true`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-10-02T21:10:47Z","receivedAt":"2019-10-02T21:10:51Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWhen parsing the diffs, `range-diff` expects to see the prefixes `a/`\nand `b/` in the diff headers.\n\nThese prefixes can be forced off via the config setting\n`diff.noprefix=true`. As `range-diff` is not prepared for that\nsituation, this will cause a segmentation fault.\n\nLet's avoid that by passing the `--no-prefix` option to the `git log`\nprocess that generates the diffs that `range-diff` wants to parse.\nAnd of course expect the output to have no prefixes, then.\n\nReported-by: Michal Suchánek <msuchanek@suse.de>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n range-diff.c          | 3 ++-\n t/t3206-range-diff.sh | 4 ++++\n 2 files changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/range-diff.c b/range-diff.c\nindex ba1e9a4265..f2fc1e02c2 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -52,6 +52,7 @@ static int read_patches(const char *range, struct string_list *list)\n \n \targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n \t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n+\t\t\t\"--no-prefix\",\n \t\t\t/*\n \t\t\t * Choose indicators that are not used anywhere\n \t\t\t * else in diffs, but still look reasonable\n@@ -111,7 +112,7 @@ static int read_patches(const char *range, struct string_list *list)\n \t\t\tif (!util->diff_offset)\n \t\t\t\tutil->diff_offset = buf.len;\n \t\t\tline[len - 1] = '\\n';\n-\t\t\tlen = parse_git_diff_header(&root, &linenr, 1, line,\n+\t\t\tlen = parse_git_diff_header(&root, &linenr, 0, line,\n \t\t\t\t\t\t    len, size, &patch);\n \t\t\tif (len < 0)\n \t\t\t\tdie(_(\"could not parse git header '%.*s'\"), (int)len, line);\ndiff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh\nindex 0120f769f1..64b66f2094 100755\n--- a/t/t3206-range-diff.sh\n+++ b/t/t3206-range-diff.sh\n@@ -461,4 +461,8 @@ test_expect_success 'format-patch --range-diff as commentary' '\n \tgrep \"> 1: .* new message\" 0001-*\n '\n \n+test_expect_success 'range-diff overrides diff.noprefix internally' '\n+\tgit -c diff.noprefix=true range-diff HEAD^...\n+'\n+\n test_done\n-- \ngitgitgadget\n"},{"id":"383316","messageId":"xmqqv9t6d5iy.fsf@gitster-ct.c.googlers.com","threadId":"51958","inReplyTo":"xmqq4l0qewu5.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] range-diff: internally force `diff.noprefix=false`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-03T00:41:41Z","receivedAt":"2019-10-03T00:41:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n>> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>\n>> When parsing the diffs, `range-diff` expects to see the prefixes `a/`\n>> and `b/` in the diff headers.\n>\n> If so, passing src/dst prefix as command line option is a much\n> better solution, I think.  diff.noprefix may not stay to be (or it\n> may already not to be) the only thing how the prefix gets chosen.\n\nThat is, \"--src-prefix=a/ --dst-prefix=b/\", so that configuration\nvariables yet to be invented for setting prefixes different from a/\nand b/ can also be overridden, not just diff.noprefix (ancient Git\nused l/ and k/ as src and dst prefix, IIRC).\n\n\n"},{"id":"383317","messageId":"xmqqr23ud5ff.fsf@gitster-ct.c.googlers.com","threadId":"51958","inReplyTo":"nycvar.QRO.7.76.6.1910022229340.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 1/1] range-diff: internally force `diff.noprefix=false`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-03T00:43:48Z","receivedAt":"2019-10-03T00:43:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> While at it, I invert the logic in v2: instead of forcing a prefix, I\n> now force no prefix (and reduce the strip level from 1 to 0 when parsing\n> the diff header).\n\nAh, that approach would also work and may be conceptually cleaner\nthan requiring a/ and b/ prefix and forcing them.\n"},{"id":"383323","messageId":"xmqq1rvud1dm.fsf@gitster-ct.c.googlers.com","threadId":"51958","inReplyTo":"9993a607beaafc66f72e1be3f158074cd121b4bb.1570050645.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 1/1] range-diff: internally force `diff.noprefix=true`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-03T02:11:17Z","receivedAt":"2019-10-03T02:11:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> When parsing the diffs, `range-diff` expects to see the prefixes `a/`\n> and `b/` in the diff headers.\n>\n> These prefixes can be forced off via the config setting\n> `diff.noprefix=true`. As `range-diff` is not prepared for that\n> situation, this will cause a segmentation fault.\n>\n> Let's avoid that by passing the `--no-prefix` option to the `git log`\n> process that generates the diffs that `range-diff` wants to parse.\n> And of course expect the output to have no prefixes, then.\n\nLooks good.  Thanks.\n"}]}