projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 652 forks source link

Adding Safe Directory Git Config #3450

Closed shpraka closed 1 year ago

suwatch commented 1 year ago

Thanks for taking this on. This happens on all Kudu start up (whether or not customers were using git). This impacts both kudu start up time and reliability. Could you see if you could get around w/o using git.exe? The trick is to go after the gitconfig file.

This is my prototype .. but we need to think thru idempotency as well as scenario where user profiles is enabled.

https://github.com/projectkudu/kudu/pull/3443/commits/3fd0354ca97aa361106ba117ab9950b196f02c9f

shpraka commented 1 year ago

@suwatch your changes looks more clean. should we add that then? Also I couldn't understand what you meant by userprofiles scenario? Using %HOME%/.gitconfig should suffice right?

suwatch commented 1 year ago

It needs refinement and more testing. For instance, if customer already have the git config, how do we check that settings already there and avoid checking the next time (along the same lines as installation txt for hint). we need to test when user profile is enabled since it may not be on this location.

shpraka commented 1 year ago

@suwatch something like generating the file with safe.directory and when file is generated don't add it next time the way we add discoveryHint file in RU?

suwatch commented 1 year ago

Something like that. The goal is we want to do it once and ability to cheaply check if already done that (w/o opening and looking at file content).