even more careful push and pull
authorChris Koeritz <fred@gruntose.com>
Fri, 10 Nov 2017 00:51:47 +0000 (19:51 -0500)
committerChris Koeritz <fred@gruntose.com>
Fri, 10 Nov 2017 00:51:47 +0000 (19:51 -0500)
this may working now; we are comparing the branch to the parent, and were definitely seeing those as different at one point.  but now with a healthy development branch, the parent and branch are the same.  so the rule should be, hopefully, (1) when parent is different than self, you pull from your parent but push to yourself and (2) when parent and self are same, just push and pull.  if that's not the right grokking of it, then i will need to rethink some things.

scripts/rev_control/version_control.sh

index 3eaa05ba6ae8e9149b806962d03ac294e08ff00c..ccb14c25d577784d480f4dfa77b375c45b7c7ca8 100644 (file)
@@ -81,13 +81,16 @@ function do_checkin()
       # catch if the diff-index failed somehow.
       retval+=$?
 
-#push the changes to where?  locally?
-      git push 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
-      retval+=${PIPESTATUS[0]}
+      local myself="$(my_branch_name)"
+      local parent="$(parent_branch_name)"
 
       # upload any changes to the upstream repo so others can see them.
-      if [ "$(my_branch_name)" != "master" ]; then
-        git push origin "$(my_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
+      if [ "$myself" != "$parent" ]; then
+        git push origin "$(myself)" 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
+        retval+=${PIPESTATUS[0]}
+      else
+        # this branch is the same as the parent, so just push.
+        git push 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
         retval+=${PIPESTATUS[0]}
       fi
 
@@ -261,12 +264,16 @@ function do_update()
     if test_writeable ".git"; then
       $blatt
       retval=0
+      local myself="$(my_branch_name)"
+      local parent="$(parent_branch_name)"
 
-      git pull origin "$(parent_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
-      retval+=${PIPESTATUS[0]}
-
-      git pull origin "$(my_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
-      retval+=${PIPESTATUS[0]}
+      if [ "$myself" != "$parent" ]; then
+        git pull origin "$parent" 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
+        retval+=${PIPESTATUS[0]}
+      else
+        git pull 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
+        retval+=${PIPESTATUS[0]}
+      fi
     fi
   else
     # this is not an error necessarily; we'll just pretend they planned this.