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

Re: [PATCH] test: add git apply whitespace expansion tests

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 18, 2015, 22:11 UTC
Message-ID
<CAPc5daXVk_ROUy7rmzS0aosWvE2wqw8tHZgomHHkay9CZjhbiw@mail.gmail.com>
In-Reply-To
<102e322e68e78e39a7c227f3f3e102c@74d39fa044aa309eaea14b9f57fe79c>
On Sun, Jan 18, 2015 at 2:49 AM, Kyle J. McKay <mackyle@gmail.com> wrote:
Show 5 quoted lines
> * Here's some tests.  With "apply: make update_pre_post_images() sanity
>   check the given postlen" but not "apply: count the size of postimage
>   correctly" test 1/4 and 4/4 trigger the 'die("BUG: postlen...' but
>   test 2/4 and 3/4 do not although they fail because git apply generates
>   garbage.

Do the failing cases that do not trigger the new postlen check fail because the original (mis)counting thinks (incorrectly) that the rewritten result _should_ fit within the original postlen (hence we allow an in-place rewrite by passing postlen=0 to the helper), but in fact after rewriting postimage->len ends up being longer due to the miscounting?

Previous: Kyle J. McKayNext: Kyle J. McKay
Message 12 of 26 in “Segmentation fault in git apply”
  1. Michael BlumeJan 14, 2015
  2. Michael BlumeJan 14, 2015
  3. Michael BlumeJan 14, 2015
  4. Michael BlumeJan 14, 2015
  5. Michael BlumeJan 14, 2015
  6. Michael BlumeJan 14, 2015
  7. Kyle J. McKayJan 15, 2015
  8. Kyle J. McKayJan 15, 2015
  9. Junio C HamanoJan 16, 2015
  10. apply: count the size of postimage correctlyJunio C Hamano, Jan 16, 2015
  11. test: add git apply whitespace expansion testsKyle J. McKay, Jan 18, 2015
  12. Junio C HamanoJan 18, 2015
  13. Kyle J. McKayJan 19, 2015
  14. Junio C HamanoJan 21, 2015
  15. Kyle J. McKayJan 22, 2015
  16. Junio C HamanoJan 22, 2015
  17. Kyle J. McKayJan 23, 2015
  18. 0/4 apply --whitespace=fix buffer corruption fixJunio C Hamano, Jan 22, 2015
  19. 1/4 apply.c: typofixJunio C Hamano, Jan 22, 2015
  20. Stefan BellerJan 22, 2015
  21. Junio C HamanoJan 22, 2015
  22. Stefan BellerJan 22, 2015
  23. 2/4 apply: make update_pre_post_images() sanity check the given postlenJunio C Hamano, Jan 22, 2015
  24. 3/4 apply: count the size of postimage correctlyJunio C Hamano, Jan 22, 2015
  25. 4/4 apply: detect and mark whitespace errors in context lines when fixingJunio C Hamano, Jan 22, 2015
  26. Junio C HamanoJan 14, 2015

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.