GNOME Bugzilla – Bug 774825
Changing the URL of a git repository on the moduleset is broken when using a dvcs_mirror_dir
Last modified: 2016-12-13 17:13:19 UTC
When using a local directory to mirror/cache the sources: jhbuildrc_globals['dvcs_mirror_dir'] = '/home/user/jhbuild_mirror' If some of the git repositories on the moduleset is updated to a new URL (a fork), the remote URL on the git repository that mirrors it is not updated. This breaks things.
Created attachment 340483 [details] [review] Ensure git remote is updated correctly when using a dvcs_mirror_dir
Review of attachment 340483 [details] [review]: I guess I don't understand the code, it looks like it's calling 'git remote set-url' twice in a row redundantly? Once in self.update_dvcs_mirror and then once again right under that?
(In reply to Michael Catanzaro from comment #2) > Review of attachment 340483 [details] [review] [review]: > > I guess I don't understand the code, it looks like it's calling 'git remote > set-url' twice in a row redundantly? Once in self.update_dvcs_mirror and > then once again right under that? Right. When you set in your jhbuilrc file this: jhbuildrc_globals['dvcs_mirror_dir'] = '/home/user/jhbuild_mirror' Then JHBuild mantains a bare git repository that uses as a mirror of the upstream one at /home/user/jhbuild_mirror. We use this on the WebKitGTK+ bots to avoid fetching the same repository over and over after a clean build. A similar feature is available also for tarballs by setting jhbuildrc_globals['tarballdir']. When using this feature, the remote on the git repository that is checked out on the Sources directory is updated to point to your local folder /home/user/jhbuild_mirror containing this mirror. And when you update your sources, JHBuild updates your clone of the repository from the local mirror, and after that updates the mirror. What this patch does is: 1. Ensure that the remote URL for the mirror (the one at /home/user/jhbuild_mirror) is automatically updated with the module's URL from the moduleset. 2. First fetch the mirror for new changes upstream, then update the clone of the mirror on the Sources directory.
(In reply to Carlos Alberto Lopez Perez from comment #3) > (In reply to Michael Catanzaro from comment #2) > > Review of attachment 340483 [details] [review] [review] [review]: > > > > I guess I don't understand the code, it looks like it's calling 'git remote > > set-url' twice in a row redundantly? Once in self.update_dvcs_mirror and > > then once again right under that? > > Right. > > When you set in your jhbuilrc file this: > > jhbuildrc_globals['dvcs_mirror_dir'] = '/home/user/jhbuild_mirror' > > Then JHBuild mantains a bare git repository that uses as a mirror of the > upstream one at /home/user/jhbuild_mirror. > > We use this on the WebKitGTK+ bots to avoid fetching the same repository > over and over after a clean build. A similar feature is available also for > tarballs by setting jhbuildrc_globals['tarballdir']. > > When using this feature, the remote on the git repository that is checked > out on the Sources directory is updated to point to your local folder > /home/user/jhbuild_mirror containing this mirror. > > And when you update your sources, JHBuild updates your clone of the > repository from the local mirror, and after that updates the mirror. > > > What this patch does is: > > 1. Ensure that the remote URL for the mirror (the one at > /home/user/jhbuild_mirror) is automatically updated with the module's URL > from the moduleset. > 2. First fetch the mirror for new changes upstream, then update the clone of > the mirror on the Sources directory. Maybe I didn't expressed myself 100% clear. With this feature enabled there are two repositories: the one in the Sources dir that is checked out, and the mirror one (a bare git repository). Currently 'git remote set-url' is executed as expected on the one that is checked out in the Sources directory (with this feature enabled it is pointing to your local folder containing the mirror). What is missing is calling 'git remote set-url' on the mirror itself that should point to the upstream URL from the moduleset.
Review of attachment 340483 [details] [review]: OK!
Can you please commit this? I'm not committer. Thanks
Attachment 340483 [details] pushed as e58ee08 - Ensure git remote is updated correctly when using a dvcs_mirror_dir