Git development
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Yongqiang Tian <yqtian668@gmail.com>
Cc: "René Scharfe" <l.s.r@web.de>, "Patrick Steinhardt" <ps@pks.im>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	git@vger.kernel.org
Subject: Re: [PATCH] compat/winansi: fix die_lasterr() argument formatting
Date: Mon, 21 Sep 2026 06:06:52 +0200	[thread overview]
Message-ID: <9c1cde3d-92c4-4684-834e-bae97fd33f5f@kdbg.org> (raw)
In-Reply-To: <CAEs0Zp4LK1ZHkL0tdi_k_=-u86HVm07FzyOJdO-=+DY9c3ZrYA@mail.gmail.com>

Am 21.09.26 um 05:00 schrieb Yongqiang Tian:
> 3. Remove die_lasterr() and report GetLastError() directly at those
>    call sites. This avoids the va_list forwarding, allocation, and
>    errno conversion altogether.
> 
> The third direction now seems the simplest to me. It also follows
> existing Windows-specific code in Git that reports GetLastError()
> directly, for example:
> 
> https://github.com/git/git/blob/9a0c4701dcd5725c4184599322b52933ff5005ca/compat/win32/syslog.c#L10-L13
> 
> and:
> 
> https://github.com/git/git/blob/9a0c4701dcd5725c4184599322b52933ff5005ca/compat/fsmonitor/fsm-listen-win32.c#L106-L109

Sounds reasonable to me.

> -               die_lasterr("DuplicateHandle(%li) failed",
> -                       (long) (intptr_t) hnd);
> +               die("DuplicateHandle(%p) failed: Windows error %lu",
> +                   (void *)hnd, GetLastError());
But please leave the conversion to %p for another time.

Concerning the text "Windows error", please follow existing practice.

-- Hannes


  reply	other threads:[~2026-09-21  4:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  4:23 [PATCH] compat/winansi: fix die_lasterr() argument formatting Yongqiang Tian
2026-09-16  4:29 ` Junio C Hamano
2026-09-16  6:13 ` Johannes Sixt
2026-09-16  6:33 ` René Scharfe
2026-09-16  7:09   ` Johannes Sixt
2026-09-21  3:00     ` Yongqiang Tian
2026-09-21  4:06       ` Johannes Sixt [this message]
2026-09-21  6:20 ` [PATCH v2] " Yongqiang Tian
2026-09-21 17:18   ` Junio C Hamano
2026-09-21 23:49     ` Yongqiang Tian
2026-09-21 23:47   ` [PATCH v3] " Yongqiang Tian
2026-09-23  4:41     ` Johannes Sixt

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=9c1cde3d-92c4-4684-834e-bae97fd33f5f@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=l.s.r@web.de \
    --cc=ps@pks.im \
    --cc=yqtian668@gmail.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