addons/git: fix interaction with git's safe.directory#421
Conversation
Codecov Report
@@ Coverage Diff @@
## master #421 +/- ##
==========================================
+ Coverage 95.86% 96.03% +0.16%
==========================================
Files 55 55
Lines 7666 7888 +222
Branches 1870 1963 +93
==========================================
+ Hits 7349 7575 +226
+ Misses 196 194 -2
+ Partials 121 119 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
2642188 to
697dd59
Compare
|
@thesamesam does this solution make sense for you? |
laumann
left a comment
There was a problem hiding this comment.
Looks good, the debugging print line should probably go. Nice work.
697dd59 to
1b87672
Compare
thesamesam
left a comment
There was a problem hiding this comment.
We might need to revisit whether we really want to ignore 'git log' in future (probably by revisiting git bindings in future).
Unfortunately, not that long ago at all, when radhermit tried to use the various git Python bindings out there, IIRC they were all far slower and had other limitations. But w/e.
This is what I was expecting and looks good, thanks!
When using GitLog class, it runs the git commands with clean git config, (aka it uses an empty one) which results in inability to use pkgcheck scan on overlays (as it tries to access system's gentoo repo, which is owned by root). If the user set safe.directory in his config, it will still not work, as we override user's config. Fix it by creating a temporary file, which we fill with minimal config which disables safe.directory feature, and passing it as the config file to the git log command. Resolves: #412 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1b87672 to
5c43a71
Compare
When using GitLog class, it runs the git commands with clean git config, (aka it uses an empty one) which results in inability to use pkgcheck scan on overlays (as it tries to access system's gentoo repo, which is owned by root). If the user set safe.directory in his config, it will still not work, as we override user's config.
Fix it by creating a temporary file, which we fill with minimal config which disables safe.directory feature, and passing it as the config file to the git log command.
Resolves: #412