From: Patrick Steinhardt <ps@pks.im>
To: Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Elijah Newren <newren@gmail.com>,
Phillip Wood <phillip.wood123@gmail.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2 1/5] merge-tree --stdin: flush stdout to avoid deadlock
Date: Wed, 19 Feb 2025 07:23:47 +0100 [thread overview]
Message-ID: <Z7V48_q3Uu9d0D3Q@pks.im> (raw)
In-Reply-To: <3b3179785098580f3336bb24bdbaf0aa1366bfcd.1739895879.git.gitgitgadget@gmail.com>
On Tue, Feb 18, 2025 at 04:24:35PM +0000, Phillip Wood via GitGitGadget wrote:
> diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
> index 9a6c8b4e4cf..57f4340faba 100644
> --- a/builtin/merge-tree.c
> +++ b/builtin/merge-tree.c
> @@ -18,6 +18,7 @@
> #include "tree.h"
> #include "config.h"
> #include "strvec.h"
> +#include "write-or-die.h"
>
> static int line_termination = '\n';
>
> @@ -623,6 +624,7 @@ int cmd_merge_tree(int argc,
> } else {
> die(_("malformed input line: '%s'."), buf.buf);
> }
> + maybe_flush_or_die(stdout, "stdout");
>
> if (result < 0)
> die(_("merging cannot continue; got unclean result of %d"), result);
I was briefly wondering whether we should rather move this into
`real_merge()` itself, which is responsible for writing to stdout. But
the only other callsite doesn't really care as it will exit immediately
anyway. So this is probably fine.
Overall the series looks good to me, thanks!
Patrick
next prev parent reply other threads:[~2025-02-19 6:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 16:37 [PATCH 0/5] merge-tree --stdin: flush stdout Phillip Wood via GitGitGadget
2025-02-16 16:37 ` [PATCH 1/5] merge-tree --stdin: flush stdout to avoid deadlock Phillip Wood via GitGitGadget
2025-02-17 20:01 ` Elijah Newren
2025-02-16 16:37 ` [PATCH 2/5] merge-tree: remove redundant code Phillip Wood via GitGitGadget
2025-02-17 20:15 ` Elijah Newren
2025-02-18 10:01 ` Phillip Wood
2025-02-16 16:37 ` [PATCH 3/5] merge-tree: only use basic merge config Phillip Wood via GitGitGadget
2025-02-16 16:37 ` [PATCH 4/5] merge-tree: improve docs for --stdin Phillip Wood via GitGitGadget
2025-02-17 20:26 ` Elijah Newren
2025-02-18 10:02 ` Phillip Wood
2025-02-18 15:56 ` Elijah Newren
2025-02-16 16:37 ` [PATCH 5/5] merge-tree: fix link formatting in html docs Phillip Wood via GitGitGadget
2025-02-17 20:30 ` Elijah Newren
2025-02-18 16:24 ` [PATCH v2 0/5] merge-tree --stdin: flush stdout Phillip Wood via GitGitGadget
2025-02-18 16:24 ` [PATCH v2 1/5] merge-tree --stdin: flush stdout to avoid deadlock Phillip Wood via GitGitGadget
2025-02-19 6:23 ` Patrick Steinhardt [this message]
2025-02-19 14:55 ` Phillip Wood
2025-02-19 16:02 ` Junio C Hamano
2025-02-18 16:24 ` [PATCH v2 2/5] merge-tree: remove redundant code Phillip Wood via GitGitGadget
2025-02-18 16:24 ` [PATCH v2 3/5] merge-tree: only use basic merge config Phillip Wood via GitGitGadget
2025-02-18 16:24 ` [PATCH v2 4/5] merge-tree: improve docs for --stdin Phillip Wood via GitGitGadget
2025-02-18 16:24 ` [PATCH v2 5/5] merge-tree: fix link formatting in html docs Phillip Wood via GitGitGadget
2025-02-18 16:46 ` [PATCH v2 0/5] merge-tree --stdin: flush stdout Elijah Newren
2025-02-18 16:54 ` Phillip Wood
2025-02-18 19:35 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z7V48_q3Uu9d0D3Q@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=newren@gmail.com \
--cc=phillip.wood123@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).