Skip to content

Avoid segmentation fault in git range-diff when diff.noprefix=true #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dscho
Copy link
Member

@dscho dscho commented Oct 2, 2019

This PR was inspired by this bug report: https://public-inbox.org/git/[email protected]/T/#me576615d7a151cf2ed46186c482fbd88f9959914

Changes since v1:

  • Use a command-line option instead of a command-line config setting.
  • Instead of forcing a prefix, force no prefix (and adjust the strip level).
  • Fix typo "all" -> "call" in the commit message (and adjust it to reflect the other changes since v1, too).

Cc: Eric Sunshine [email protected], Michal Suchánek [email protected]

@dscho
Copy link
Member Author

dscho commented Oct 2, 2019

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 2, 2019

Submitted as [email protected]

When parsing the diffs, `range-diff` expects to see the prefixes `a/`
and `b/` in the diff headers.

These prefixes can be forced off via the config setting
`diff.noprefix=true`. As `range-diff` is not prepared for that
situation, this will cause a segmentation fault.

Let's avoid that by passing the `--no-prefix` option to the `git log`
process that generates the diffs that `range-diff` wants to parse.
And of course expect the output to have no prefixes, then.

Reported-by: Michal Suchánek <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho force-pushed the range-diff-requires-diff-prefix branch from 1f84f92 to 9993a60 Compare October 2, 2019 20:26
@dscho
Copy link
Member Author

dscho commented Oct 2, 2019

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 2, 2019

Submitted as [email protected]

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 3, 2019

This branch is now known as js/range-diff-noprefix.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 3, 2019

This patch series was integrated into pu via git@0a9ea6d.

@gitgitgadget gitgitgadget bot added the pu label Oct 3, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Oct 4, 2019

This patch series was integrated into pu via git@9f8f210.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 4, 2019

This patch series was integrated into pu via git@728ebf4.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 4, 2019

This patch series was integrated into next via git@56cf767.

@gitgitgadget gitgitgadget bot added the next label Oct 4, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Oct 6, 2019

This patch series was integrated into pu via git@650ab5e.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 7, 2019

This patch series was integrated into pu via git@fadd080.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 8, 2019

This patch series was integrated into pu via git@ba49118.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 9, 2019

This patch series was integrated into pu via git@0a9ce69.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 9, 2019

This patch series was integrated into pu via git@728f5c6.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 11, 2019

This patch series was integrated into pu via git@159cdab.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 11, 2019

This patch series was integrated into next via git@159cdab.

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 11, 2019

This patch series was integrated into master via git@159cdab.

@gitgitgadget gitgitgadget bot added the master label Oct 11, 2019
@gitgitgadget gitgitgadget bot closed this Oct 11, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Oct 11, 2019

Closed via 159cdab.

@dscho dscho deleted the range-diff-requires-diff-prefix branch October 11, 2019 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant