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

Re: [PATCH 1/1] t6500(mingw): use the Windows PID of the shell

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 7, 2019, 22:25 UTC
Message-ID
<CAPig+cQG4+A+G+i+8RqpDAY2PveULVJ5iNR4HYEUPAd_4Ub04w@mail.gmail.com>
In-Reply-To
<ba78a47b873c5f044cbfb147b30a801cc90fb0ac.1557265888.git.gitgitgadget@gmail.com>

On Tue, May 7, 2019 at 5:51 PM Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 17 quoted lines
> [...]
> Let's fix this by making sure that the Windows PID is written into
> `gc.pid` in this test script soo that `git.exe` is able to understand
> that that process does indeed still exist.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> @@ -162,7 +162,15 @@ test_expect_success 'background auto gc respects lock for all operations' '
> +       shell_pid=$$ &&
> +       if test_have_prereq MINGW && test -f /proc/$shell_pid/winpid
> +       then
> +               # In Git for Windows, Bash (actually, the MSYS2 runtime) has a
> +               # different idea of PIDs than git.exe (actually Windows). Use
> +               # the Windows PID in this case.
> +               shell_pid=$(cat /proc/$shell_pid/winpid)
> +       fi &&
> +       printf "%d %s" "$shell_pid" "$hostname" >.git/gc.pid &&

I wonder if it would make sense to abstract this away behind a shell function named shell_pid() which can be specialized for MINGW, much like the shell function pwd() is specialized on Windows.

Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 3 of 5 in “Proactively fix a test issue with v3.x of the MSYS2 runtime”
  1. 0/1 Proactively fix a test issue with v3.x of the MSYS2 runtimeJohannes Schindelin via GitGitGadget, May 7, 2019
  2. 1/1 t6500(mingw): use the Windows PID of the shellJohannes Schindelin via GitGitGadget, May 7, 2019
  3. Eric SunshineMay 7, 2019
  4. Junio C HamanoMay 8, 2019
  5. Junio C HamanoMay 8, 2019

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.