From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: dtable: Delete old kludge code for /dev/tty.
Date: Fri, 7 Jul 2023 12:30:21 +0900 [thread overview]
Message-ID: <20230707123021.f125d63930f89b0416a430d5@nifty.ne.jp> (raw)
In-Reply-To: <2346de89-b679-4463-1937-61e1f9f76c51@gmx.de>
On Tue, 4 Jul 2023 17:59:41 +0200 (CEST)
Johannes Schindelin wrote:
> Hi Takashi,
>
> On Tue, 4 Jul 2023, Takashi Yano wrote:
>
> > On Mon, 3 Jul 2023 12:52:25 +0200
> > Corinna Vinschen wrote:
> > >
> > > On Jun 27 22:28, Takashi Yano wrote:
> > > >
> > > > diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
> > > > index 18e0f3097..9427e238e 100644
> > > > --- a/winsup/cygwin/dtable.cc
> > > > +++ b/winsup/cygwin/dtable.cc
> > > > @@ -598,12 +598,7 @@ fh_alloc (path_conv& pc)
> > > > fh = cnew (fhandler_mqueue);
> > > > break;
> > > > case FH_TTY:
> > > > - if (!pc.isopen ())
> > > > - {
> > > > - fhraw = cnew_no_ctor (fhandler_console, -1);
> > > > - debug_printf ("not called from open for /dev/tty");
> > > > - }
> > >
> > > This is ok-ish. The problem is that the original patch 23771fa1f7028
> > > does not explain *why* it assigned a console fhandler if the file is not
> > > open. Given that, it's not clear what side-effects we might encounter
> > > if we change this. Do you understand the situation here can you explain
> > > why dropping this kludge will do the right thing now? If so, it would
> > > be great to have a good description of the original idea behind the
> > > code and why we don't need it anymore in the commit message.
> >
> > I am not really sure the reason why the kludge code was needed.
> > However, I noticed stat() fails before the commit 6ae28c22639d
> > without the kludge code if the program calls setsid(). After the
> > commit 6ae28c22639d, this does not happen. Therefore, I think
> > this kludge code is no longer necessary.
>
> FWIW this is the exact kind of issue I keep pointing out with these commit
> messages.
>
> It is quite often totally unclear what the issues are, there are sometimes
> links to threads where one could potentially go and hunt and guess what
> the outcome of that discussion was.
>
> And more often than not, these commit messages talk vaguely about "This
> fixes the issue by dropping a kludge" or something similar, instead of
> giving a clear and comprehensive description as to what the problem is,
> why the code was faulty, what is done instead, and what alternatives were
> considered and the reasons why they were rejected.
>
> This leaves a lot of room for improvement without which we're prone to
> repeat these increasingly frustrating exchanges.
>
> Once again, I would highly recommend to read
> https://github.blog/2022-06-30-write-better-commits-build-better-projects/
> and craft commit messages based on the provided guidance. I promise you
> that you will no longer have to say "I am not really sure the reason why
> the kludge code was needed", like, ever again, if you follow that
> article's advice.
Thanks for the advice. I will keep your adivce in mind.
--
Takashi Yano <takashi.yano@nifty.ne.jp>
prev parent reply other threads:[~2023-07-07 3:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 13:28 Takashi Yano
2023-07-03 10:52 ` Corinna Vinschen
2023-07-04 9:58 ` Takashi Yano
2023-07-04 15:59 ` Johannes Schindelin
2023-07-07 3:30 ` Takashi Yano [this message]
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=20230707123021.f125d63930f89b0416a430d5@nifty.ne.jp \
--to=takashi.yano@nifty.ne.jp \
--cc=cygwin-patches@cygwin.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).