[PATCH] patman: expand user home when looking for the alias file

Otavio Salvador otavio at ossystems.com.br
Tue Jan 4 17:47:05 CET 2022


This allows the use of git aliases files relative to the user home,
without using the full path to the file.

Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---

 tools/patman/gitutil.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 5e4c1128dcb..172de4aae59 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -616,8 +616,13 @@ def GetAliasFile():
     """
     fname = command.OutputOneLine('git', 'config', 'sendemail.aliasesfile',
             raise_on_error=False)
+
     if fname:
-        fname = os.path.join(GetTopLevel(), fname.strip())
+        fname = fname.strip()
+        if fname.startswith("~/"):
+            fname = fname.replace("~", os.path.expanduser('~'), 1)
+        fname = os.path.join(GetTopLevel(), fname)
+
     return fname
 
 def GetDefaultUserName():
-- 
2.34.1



More information about the U-Boot mailing list