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

Simon Glass sjg at chromium.org
Wed Jan 12 22:20:48 CET 2022


Hi Otavio,

+Brian Norris

On Tue, 4 Jan 2022 at 09:47, Otavio Salvador <otavio at ossystems.com.br> wrote:
>
> 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
>

Brian (on cc) sent a similar patch. Could you please take a look at it
and see what is missing for your case?

Regards,
Simon


More information about the U-Boot mailing list