[jhbuild] git: Rebase rather than pull



commit 2405975729476034fd942b248a53254b24188aa1
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed May 8 18:21:30 2013 +0300

    git: Rebase rather than pull
    
    There is no point in pulling changes from remote immediately after a
    'remote update'. We should simply do a rebase.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699936

 jhbuild/versioncontrol/git.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index 1880f93..a93a9bd 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -278,9 +278,10 @@ class GitBranch(Branch):
             buildscript.execute(switch_command, cwd=self.get_checkoutdir(),
                     extra_env=get_git_extra_env())
 
-    def pull_current_branch(self, buildscript):
+    def rebase_current_branch(self, buildscript):
         """Pull the current branch if it is tracking a remote branch."""
-        if not self.is_tracking_a_remote_branch(self.get_current_branch()):
+        branch = self.get_current_branch();
+        if not self.is_tracking_a_remote_branch(branch):
             return
 
         git_extra_args = {'cwd': self.get_checkoutdir(),
@@ -292,7 +293,8 @@ class GitBranch(Branch):
             buildscript.execute(['git', 'stash', 'save', 'jhbuild-stash'],
                     **git_extra_args)
 
-        buildscript.execute(['git', 'pull', '--rebase'], **git_extra_args)
+        buildscript.execute(['git', 'rebase', 'origin/' + branch],
+                            **git_extra_args)
 
         if stashed:
             # git stash pop was introduced in 1.5.5,
@@ -439,7 +441,7 @@ class GitBranch(Branch):
 
         self.switch_branch_if_necessary(buildscript)
 
-        self.pull_current_branch(buildscript)
+        self.rebase_current_branch(buildscript)
 
         self._update_submodules(buildscript)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]