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

Re: [PATCH] Don't try to reclose in command_close_bidi_pipe

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Jan 31, 2009, 00:03 UTC
Message-ID
<be6fef0d0901301603m452b1579q509bdc997ecad7c4@mail.gmail.com>
In-Reply-To
<a891e1bd0901300706h4fdffe24m78c418f8c1ae7cd8@mail.gmail.com>
Hi,
On Fri, Jan 30, 2009 at 11:06 PM, Yuval Kogman <nothingmuch@woobling.org> wrote:
Show 11 quoted lines
> Here is an example:
> http://github.com/yanick/git-cpan-patch/blob/ed67d3f86f371764935fd0da3e7f08536c95b606/git-cpan-import#L190
>
> Since git-commit-tree requires the message to be written before it can
> write the sha1 of the new commit object, the handle has to be closed
> already, which makes command_close_bidi_pipe die with an error.
> The workaround in the linked code reopens a fake handle so that
> close() will not error.
> For what it's worth, I've been poking at t/t9700/test.pl but since
> it's pretty sparse I figured I should contribute this fix
> independently.

Your usage seems to a very special case. You're closing the handle, and then invoking the method "command_close_bidi_pipe", whose job is to close the pipe handles passed to it (among other things). So, it doesn't seem very good to make "command_close_bidi_pipe" to take into account that you closed your handle independently.

Maybe you could write a pair of new functions for the commit-tree command in the Git package, something like the "_open_hash_and_insert_object_if_needed" and "hash_and_insert_object" pair.

-- 
Cheers,
Ray Chuan
Previous: Yuval Kogman
Message 4 of 4 in “Don't try to reclose in command_close_bidi_pipe”
  1. Don't try to reclose in command_close_bidi_pipeYuval Kogman, Jan 30, 2009
  2. Tay Ray ChuanJan 30, 2009
  3. Yuval KogmanJan 30, 2009
  4. Tay Ray ChuanJan 31, 2009

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.