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

Re: latest clone/pull of git.git problems with setlinebuf.

From
BGBoyd Lynn Gerber <gerberb@zenez.com>
Date
Sep 4, 2008, 05:29 UTC
Message-ID
<alpine.LNX.1.10.0809032325080.25336@suse104.zenez.com>
In-Reply-To
<7vhc8w8rme.fsf@gitster.siamese.dyndns.org>
On Wed, 3 Sep 2008, Junio C Hamano wrote:
Show 21 quoted lines
> Boyd Lynn Gerber <gerberb@zenez.com> writes:
>> On Wed, 3 Sep 2008, Junio C Hamano wrote:
>>> Ah, ok.  I should have noticed that setlinebuf() was outside POSIX (it is
>>> not usable on older BSDs either).
>>>
>>> Let's see if we can replace it with setvbuf() which is POSIX.
>>
>> This fixes the problem. on both OS's.
>
> By the way, have you actually exercised the codepath, or does your above
> "fixes" mean "compiles"?
>
> I knew it would compile on a system with POSIX setvbuf(), but I was 
> unsure about the size argument.  I know for glibc giving <NULL, 0> would 
> be equivalent to setlinebuf(), but POSIX itself leaves what exactly 
> happens to the size argument quite vague, saying only "otherwise [when 
> buf is a null pointer], size may determine the size of a buffer 
> allocated by the setvbuf() function."  Does size=0 mean it allocates 
> very little, and while it tries to line buffer the output, because the 
> buffer is so small that it fails to buffer an entire line causing early 
> flushing of the stream?
I only compiled it.  I am debuging some test errors.  I did a gmake test
This is the test that fails.  Everything before it passes.
*   ok 41: very long name in the index handled sanely
* fixed 1 known breakage(s)
* still have 1 known breakage(s)
* passed all remaining 40 test(s)
*** t0001-init.sh ***
...
*   ok 9: GIT_DIR & GIT_WORK_TREE (2)
* FAIL 10: reinit
                 (
                         unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG
                         mkdir again &&
                         cd again &&
                         git init >out1 2>err1 &&
                         git init >out2 2>err2
                 ) &&
                 grep "Initialized empty" again/out1 &&
                 grep "Reinitialized existing" again/out2 &&
                 >again/empty &&
                 test_cmp again/empty again/err1 &&
                 test_cmp again/empty again/err2
* FAIL 11: init with --template
                 mkdir template-source &&
                 echo content >template-source/file &&
                 (
                         mkdir template-custom &&
                         cd template-custom &&
                         git init --template=../template-source
                 ) &&
                 test_cmp template-source/file template-custom/.git/file
*   ok 12: init with --template (blank)
* failed 2 among 12 test(s)
gmake[2]: *** [t0001-init.sh] Error 1

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Previous: Junio C HamanoNext: Boyd Lynn Gerber
Message 8 of 9 in “latest clone/pull of git.git problems with setlinebuf.”
  1. Boyd Lynn GerberSep 4, 2008
  2. Boyd Lynn GerberSep 4, 2008
  3. Avery PennarunSep 4, 2008
  4. Boyd Lynn GerberSep 4, 2008
  5. Junio C HamanoSep 4, 2008
  6. Boyd Lynn GerberSep 4, 2008
  7. Junio C HamanoSep 4, 2008
  8. Boyd Lynn GerberSep 4, 2008
  9. Boyd Lynn GerberSep 4, 2008

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.