From: Bagas Sanjaya Date: Fri, 07 May 2021 03:25:56 GMT Subject: Re: [PATCH] tr2: log parent process name Message-ID: <3bde96f5-2df6-4c4d-7e40-e938bbb31643@gmail.com> In-Reply-To: <20210507002908.1495061-1-emilyshaffer@google.com> 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 > --- > 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