On Wed, Nov 04, 2020 at 11:18:10AM +0100, Johannes Postler wrote: > [josi@localhost typescript]$ git format-patch -1 236a9 > --output=/home/josi/tmp/patches/txt-6117.patch > 0001-Txture-Core-Implemented-whitelisting-for-groovy-scri.patch > free(): invalid pointer > Aborted (core dumped) Thanks for the report. I was able to reproduce the problem here. The issue is that "--output" was never supposed to work with format-patch. But a subtle change in the option parsing a while back caused it to be respected. And as you noticed, the documentation mistakenly mentions the option, since format-patch includes the standard diff-options text. So one obvious fix would be to forbid it and adjust the documentation. But because of the way the option parsers interact, it's surprisingly hard to do so cleanly. It's actually easier to just make it do something useful (i.e., behave like --stdout but sent to a file). So I did that instead. [1/3]: format-patch: refactor output selection [2/3]: format-patch: tie file-opening logic to output_directory [3/3]: format-patch: support --output option builtin/log.c | 37 ++++++++++++++++++++++--------------- t/t4014-format-patch.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 15 deletions(-) -Peff