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

[PATCH v2 0/4] Making an elephant out of a getline() bug

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 23, 2012, 09:42 UTC
Message-ID
<cover.1329988335.git.trast@student.ethz.ch>
In-Reply-To
<7vty2i5ie2.fsf@alter.siamese.dyndns.org>

So you all made very good points, and I don't want to repeat them. Junio's analysis

Show 6 quoted lines
> Perhaps we would want to squash something like this to the test to avoid
> "seq", using J6t's idea.  The issue is that we do not write the end of
> line for the long boundary (because it is hidden from us), keep reading
> and rejecting bogus letters, and then the tip is written without
> terminating the boundary line.  So checking boundary line is not a very
> useful test, but "fetch" and "list-heads" are.

is of course also correct for the case where the overlong line is in a boundary commit. (The analysis about the accidentally-leading '-' is also correct and can create a boundary line where there was none, like in the perl case.)

The patches in this round are:
[1] new; following up on Peff's complaint that I should document
    strbuf_getwholeline_fd, I found that the strbuf_get*line
    documentation was also lacking.
[2] previously (1/2), now with documentation added
[3] new; Junio corrected me on the ': > file' spelling, which I added
    because the start of the test used it too.  So let's just fix it
    outright to match the Git style all over.
[4] previously (2/2), now incorporating a strbuf_release and the
    suggestions for the tests as sent by Junio.  I upped the %0982 a
    bit as it felt *too* tailored for the old bug, and this way
    everyone can see immediately that it will exceed the 1024 char
    limit (without thinking about the length of a sha and accounting
    for \0 and \n).
Thomas Rast (4):
  strbuf: improve strbuf_get*line documentation
  bundle: put strbuf_readline_fd in strbuf.c with adjustments
  t5704: match tests to modern style
  bundle: use a strbuf to scan the log for boundary commits
 Documentation/technical/api-strbuf.txt |   19 +++++++++++--
 bundle.c                               |   36 +++++++-----------------
 strbuf.c                               |   16 +++++++++++
 strbuf.h                               |    1 +
 t/t5704-bundle.sh                      |   47 ++++++++++++++++----------------
 5 files changed, 67 insertions(+), 52 deletions(-)
-- 
1.7.9.1.430.g4998543
Next: Thomas Rast
Message 1 of 8 in “Making an elephant out of a getline() bug”
  1. 0/4 Making an elephant out of a getline() bugThomas Rast, Feb 23, 2012
  2. 1/4 strbuf: improve strbuf_get*line documentationThomas Rast, Feb 23, 2012
  3. Jeff KingFeb 23, 2012
  4. 2/4 bundle: put strbuf_readline_fd in strbuf.c with adjustmentsThomas Rast, Feb 23, 2012
  5. 3/4 t5704: match tests to modern styleThomas Rast, Feb 23, 2012
  6. Junio C HamanoFeb 23, 2012
  7. 4/4 bundle: use a strbuf to scan the log for boundary commitsThomas Rast, Feb 23, 2012
  8. Junio C HamanoFeb 23, 2012

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.