[PATCH] patman: Respect include directive on Git config lookup

Fei Shao fshao at chromium.org
Fri Sep 8 16:15:59 CEST 2023


People may put their user name and email in a local config file and
reference it by the include.* directives, however `git config --global`
doesn't look up the included configs by default.

Enable the --includes option explicitly to support such use cases.

Signed-off-by: Fei Shao <fshao at chromium.org>
---

 tools/patman/gitutil.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 6700057359fc..b0a12f2e8c06 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -651,7 +651,7 @@ def get_default_user_name():
     Returns:
         User name found in .gitconfig file, or None if none
     """
-    uname = command.output_one_line('git', 'config', '--global', 'user.name')
+    uname = command.output_one_line('git', 'config', '--global', '--includes', 'user.name')
     return uname
 
 
@@ -661,7 +661,7 @@ def get_default_user_email():
     Returns:
         User's email found in .gitconfig file, or None if none
     """
-    uemail = command.output_one_line('git', 'config', '--global', 'user.email')
+    uemail = command.output_one_line('git', 'config', '--global', '--includes', 'user.email')
     return uemail
 
 
-- 
2.42.0.283.g2d96d420d3-goog



More information about the U-Boot mailing list