[PATCH] De-hardcode 'origin' as the remote name

Mathieu Bridon bochecha at fedoraproject.org
Mon Mar 24 16:56:22 UTC 2014


On Mon, 2014-03-24 at 17:44 +0100, Pavol Babincak wrote:
> In the meantime I've introduced self._branch_remote (and corresponding
> self.branch_remote getter)
> 
> https://git.fedorahosted.org/cgit/rpkg.git/tree/src/pyrpkg/__init__.py#n143

I saw that, yeah.

But that doesn't work, as the code still hardcodes some 'origin' here
and there, which you just left in.

> which is used to get remote name from current branch by git track.
> Having another remote variable might be confusing. I believe we cannot
> easily merge these two member variables together so I suggest to rename
> your variable to self.default_remote.
>
> Are you ok with that?

I think a better way would be:

1. your _branch_remote defaults to 'origin', rather than raising an
error when it can't be determined automatically
2. the rest of my patch is merged, using your "branch_remote" instead of
the new "remote" I was introducing.

That way, we have the best of both worlds:
- my change which allows pyrpkg-based tools to set the remote the way
they want, and it is respected without hardcoding 'origin'
- your change which allows detecting the remote when possible

I already reworked my patches to implement the above, but I won't submit
them without testing first, and I can't really test from here, so that
will have to wait until I get to work tomorrow. ;)

> Except of note above your patch seems to work as advertised and I
> haven't found a way to break backwards compatibility.

Good, I explicitly kept it.


-- 
Mathieu



More information about the rel-eng mailing list