Thread (73 messages) 73 messages, 7 authors, 2021-08-31

Re: [PATCH] tr2: log parent process name

flat view

From: Bagas Sanjaya <hidden>
Date: 2021-05-07 03:26:02

On 07/05/21 07.29, Emily Shaffer wrote:
It can be useful to tell who invoked Git - was it invoked manually by a
user via CLI or script? By an IDE? Knowing where the Git invocation came
from can help with debugging to isolate where the problem came from.

Unfortunately, there's no cross-platform reliable way to gather the name
of the parent process. If procfs is present, we can use that; otherwise
we will need to discover the name another way. However, the process ID
should be sufficient regardless of platform.
What about on Windows?
Signed-off-by: Emily Shaffer <redacted>
---
We briefly discussed hiding this behind a config, internally. However, I
wanted to include the parent name alongside the cmd_start event, which
happens very early (maybe before config gathering?).

Maybe it's better to log the parent_name as its own event, since it
shouldn't change over the lifetime of the process?

procfs is very non-portable, though - I think this won't even work on
MacOS. So I'm curious if anybody has better suggestions for how to do
this.
Maybe we can say that "currently the method of gathering parent process
name that Git uses only work on Linux".

-- 
An old man doll... just what I always wanted! - Clara
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help