[cip-kernel-sec,2/2] remotes: call _get_configured_remotes
diff mbox series

Message ID 20190617022039.7197-2-daniel.sangorrin@toshiba.co.jp
State New
Headers show
Series
  • [cip-kernel-sec,1/2] remotes: refer to configuration files
Related show

Commit Message

Daniel Sangorrin June 17, 2019, 2:20 a.m. UTC
This is probably a copy&paste mistake that had no effect
because the contents of _get_configured_remotes and
_get_configured_branches is the same.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
 scripts/kernel_sec/branch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Hutchings June 17, 2019, 8:16 p.m. UTC | #1
On Mon, 2019-06-17 at 11:20 +0900, Daniel Sangorrin wrote:
> This is probably a copy&paste mistake that had no effect
> because the contents of _get_configured_remotes and
> _get_configured_branches is the same.
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>

Maybe it would make more sense to merge the two functions instead?

Ben.

> ---
>  scripts/kernel_sec/branch.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kernel_sec/branch.py
> b/scripts/kernel_sec/branch.py
> index ae1ca2c..3ede64a 100644
> --- a/scripts/kernel_sec/branch.py
> +++ b/scripts/kernel_sec/branch.py
> @@ -209,7 +209,7 @@ def get_remotes(mappings, mainline=None,
> stable=None):
>      remotes = RemoteMap()
>      remotes.update(_get_configured_remotes('conf/remotes.yml'))
>      remotes.update(
> -        _get_configured_branches(
> +        _get_configured_remotes(
>              os.path.expanduser('~/.config/kernel-sec/remotes.yml')))
>      for mapping in mappings:
>          left, right = arg.split(':', 1)
Daniel Sangorrin June 17, 2019, 11:48 p.m. UTC | #2
> From: Ben Hutchings <ben.hutchings@codethink.co.uk>
> 
> On Mon, 2019-06-17 at 11:20 +0900, Daniel Sangorrin wrote:
> > This is probably a copy&paste mistake that had no effect
> > because the contents of _get_configured_remotes and
> > _get_configured_branches is the same.
> >
> > Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
> 
> Maybe it would make more sense to merge the two functions instead?

I thought about that but in the future you may want to add some code that is specific to one of them. If you want me to consolidate them, what name would you use?

Thanks,
Daniel

> 
> Ben.
> 
> > ---
> >  scripts/kernel_sec/branch.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/kernel_sec/branch.py
> > b/scripts/kernel_sec/branch.py
> > index ae1ca2c..3ede64a 100644
> > --- a/scripts/kernel_sec/branch.py
> > +++ b/scripts/kernel_sec/branch.py
> > @@ -209,7 +209,7 @@ def get_remotes(mappings, mainline=None,
> > stable=None):
> >      remotes = RemoteMap()
> >      remotes.update(_get_configured_remotes('conf/remotes.yml'))
> >      remotes.update(
> > -        _get_configured_branches(
> > +        _get_configured_remotes(
> >              os.path.expanduser('~/.config/kernel-sec/remotes.yml')))
> >      for mapping in mappings:
> >          left, right = arg.split(':', 1)
> --
> Ben Hutchings, Software Developer                         Codethink Ltd
> https://www.codethink.co.uk/                 Dale House, 35 Dale Street
>                                      Manchester, M1 2HF, United Kingdom
Ben Hutchings June 18, 2019, 2:42 p.m. UTC | #3
On Mon, 2019-06-17 at 23:48 +0000, daniel.sangorrin@toshiba.co.jp
wrote:
> > From: Ben Hutchings <ben.hutchings@codethink.co.uk>
> > 
> > On Mon, 2019-06-17 at 11:20 +0900, Daniel Sangorrin wrote:
> > > This is probably a copy&paste mistake that had no effect
> > > because the contents of _get_configured_remotes and
> > > _get_configured_branches is the same.
> > > 
> > > Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
> > 
> > Maybe it would make more sense to merge the two functions instead?
> 
> I thought about that but in the future you may want to add some code
> that is specific to one of them. If you want me to consolidate them,
> what name would you use?

Actually these two functions aren't exactly the same, since the default
return value differs.  In practice that doesn't make a difference at
the moment, but logically it would be wrong to return one or the other.

So I'll apply your original patch.

Ben.

Patch
diff mbox series

diff --git a/scripts/kernel_sec/branch.py b/scripts/kernel_sec/branch.py
index ae1ca2c..3ede64a 100644
--- a/scripts/kernel_sec/branch.py
+++ b/scripts/kernel_sec/branch.py
@@ -209,7 +209,7 @@  def get_remotes(mappings, mainline=None, stable=None):
     remotes = RemoteMap()
     remotes.update(_get_configured_remotes('conf/remotes.yml'))
     remotes.update(
-        _get_configured_branches(
+        _get_configured_remotes(
             os.path.expanduser('~/.config/kernel-sec/remotes.yml')))
     for mapping in mappings:
         left, right = arg.split(':', 1)