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

[PATCH v2 0/1] vreportf: Fix interleaving issues, remove 4096 limitation

From
AGAlexandr Miloslavskiy via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 22, 2019, 14:45 UTC
Message-ID
<pull.407.v2.git.1571755538.gitgitgadget@gmail.com>
In-Reply-To
<pull.407.git.1571755147.gitgitgadget@gmail.com>

This fixes t5516 on Windows. For detailed explanation please refer to code comments in this commit.

There was a lot of back-and-forth already in vreportf(): d048a96e (2007-11-09) - 'char msg[256]' is introduced to avoid interleaving 389d1767 (2009-03-25) - Buffer size increased to 1024 to avoid truncation 625a860c (2009-11-22) - Buffer size increased to 4096 to avoid truncation f4c3edc0 (2015-08-11) - Buffer removed to avoid truncation b5a9e435 (2017-01-11) - Reverts f4c3edc0 to be able to replace control chars before sending to stderr

This fix attempts to solve all issues:
1) avoid multiple fprintf() interleaving 2) avoid truncation 3) avoid char
interleaving in fprintf() on some platforms 4) avoid buffer block
interleaving when output is large 5) avoid Out-of-order messages 6) replace
control characters in output

Other commits worthy of notice: 9ac13ec9 (2006-10-11) - Another attempt to solve interleaving. This is seemingly related to d048a96e. 137a0d0e (2007-11-19) - Addresses out-of-order for display() 34df8aba (2009-03-10) - Switches xwrite() to fprintf() in recv_sideband() to support UTF-8 emulation eac14f89 (2012-01-14) - Removes the need for fprintf() for UTF-8 emulation, so it's safe to use xwrite() again 5e5be9e2 (2016-06-28) - recv_sideband() uses xwrite() again

Signed-off-by: Alexandr Miloslavskiy alexandr.miloslavskiy@syntevo.com
[alexandr.miloslavskiy@syntevo.com]
Alexandr Miloslavskiy (1):
  vreportf: Fix interleaving issues, remove 4096 limitation
 usage.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 148 insertions(+), 6 deletions(-)
base-commit: d966095db01190a2196e31195ea6fa0c722aa732
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-407%2FSyntevoAlex%2F%230194_t5516_fixes-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-407/SyntevoAlex/#0194_t5516_fixes-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/407
Range-diff vs v1:
 1:  5fd06fa881 ! 1:  54f0d6f6b5 vreportf: Fix interleaving issues, remove 4096 limitation
     @@ -23,12 +23,12 @@
      
          Other commits worthy of notice:
          9ac13ec9 (2006-10-11) - Another attempt to solve interleaving.
     -                                                    This is seemingly related to d048a96e.
     +                            This is seemingly related to d048a96e.
          137a0d0e (2007-11-19) - Addresses out-of-order for display()
          34df8aba (2009-03-10) - Switches xwrite() to fprintf() in recv_sideband()
     -                                                    to support UTF-8 emulation
     +                            to support UTF-8 emulation
          eac14f89 (2012-01-14) - Removes the need for fprintf() for UTF-8 emulation,
     -                                                    so it's safe to use xwrite() again
     +                            so it's safe to use xwrite() again
          5e5be9e2 (2016-06-28) - recv_sideband() uses xwrite() again
      
          Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
-- 
gitgitgadget
Previous: Alexandr Miloslavskiy via GitGitGadgetNext: Alexandr Miloslavskiy via GitGitGadget
Message 3 of 16 in “vreportf: Fix interleaving issues, remove 4096 limitation”
  1. 0/1 vreportf: Fix interleaving issues, remove 4096 limitationAlexandr Miloslavskiy via GitGitGadget, Oct 22, 2019
  2. 1/1 vreportf: Fix interleaving issues, remove 4096 limitationAlexandr Miloslavskiy via GitGitGadget, Oct 22, 2019
  3. 0/1 vreportf: Fix interleaving issues, remove 4096 limitationAlexandr Miloslavskiy via GitGitGadget, Oct 22, 2019
  4. 1/1 vreportf: Fix interleaving issues, remove 4096 limitationAlexandr Miloslavskiy via GitGitGadget, Oct 22, 2019
  5. Johannes SchindelinOct 25, 2019
  6. Alexandr MiloslavskiyOct 25, 2019
  7. Johannes SchindelinOct 25, 2019
  8. Alexandr MiloslavskiyOct 25, 2019
  9. Johannes SchindelinOct 25, 2019
  10. Jeff KingOct 25, 2019
  11. Alexandr MiloslavskiyOct 26, 2019
  12. Johannes SchindelinOct 26, 2019
  13. Jeff KingOct 26, 2019
  14. Johannes SchindelinOct 28, 2019
  15. Johannes SchindelinOct 26, 2019
  16. Johannes SchindelinOct 26, 2019

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.