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

Re: [PATCH] xdiff-interface.c (buffer_is_binary): Remove buffer size limitation

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 1, 2007, 19:46 UTC
Message-ID
<7vlk8e42qb.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071201160113.GA20849@nomad.office.altlinux.org>
"Dmitry V. Levin" <ldv@altlinux.org> writes:
> When checking buffer for NUL byte, do not limit size of buffer we check.
> Otherwise we break git-rebase: git-format-patch may generate output which
> git-mailinfo cannot handle properly.

I think this is tackling a valid problem but it is a wrong solution. The change penalizes text changes which is the majority, just in case there is an unusual change that has an embedded NUL far into the file (iow, exception).

Perhaps mailinfo can be updated to handle embedded NUL.

Another alternative (I've been trying to find time to do so for quite a while now but dealing with list traffic always takes priority on my time allotment) is to update rebase not to rely on "format-patch piped to am", and I think that is more correct solution in the longer term.

In the meantime, a workaround would be to use "rebase -i". It uses cherry-pick machinery instead of "format-patch piped to am", and hopefully would handle NULs better. It probably is slower than non interactive one exactly because it uses cherry-pick, and that is the reason I am first working on updating cherry-pick before actually making the non-interactive rebase to use it.

Previous: Dmitry V. LevinNext: Dmitry V. Levin
Message 2 of 7 in “xdiff-interface.c (buffer_is_binary): Remove buffer size limitation”
  1. xdiff-interface.c (buffer_is_binary): Remove buffer size limitationDmitry V. Levin, Dec 1, 2007
  2. Junio C HamanoDec 1, 2007
  3. Dmitry V. LevinDec 3, 2007
  4. Junio C HamanoDec 3, 2007
  5. Linus TorvaldsDec 4, 2007
  6. Johannes SchindelinDec 4, 2007
  7. David KastrupDec 5, 2007

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.