[Bps-public-commit] git-sync branch, master, updated. 1c7ca6f506b19366b451e213781eb431bdca50b0

Alex Vandiver alexmv at bestpractical.com
Thu Jun 10 17:59:37 EDT 2010


The branch, master has been updated
       via  1c7ca6f506b19366b451e213781eb431bdca50b0 (commit)
       via  6acfc98dfc29eab8efb7ba2a65a32cdb48d882c9 (commit)
      from  bb65366219e150d0e0b91aef418f13552b6e241b (commit)

Summary of changes:
 .gitignore |    5 +++++
 git-sync   |   20 +++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 6acfc98dfc29eab8efb7ba2a65a32cdb48d882c9
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 10 18:00:23 2010 -0400

    git-svn doesn't actually make refs/remotes/git-svn the upstream

diff --git a/git-sync b/git-sync
index 3b4afc8..48d926e 100755
--- a/git-sync
+++ b/git-sync
@@ -509,11 +509,29 @@ sub update {
 
     print colored("[ Bare repository ]\n", "green") and return if $repo->config_bool('core.bare');
 
+
+    # We want to set up the upstream to be the svn repo temporarily
+    if ($gitsvn) {
+        my $branch = $repo->command("symbolic-ref", "HEAD"); chomp $branch;
+        if ( $branch =~ s{refs/heads/(.*)}{$1} and not $repo->config( "branch.$branch.merge" ) ) {
+            $gitsvn = -$gitsvn;
+            $repo->command("config", "branch.$branch.remote", ".");
+            $repo->command("config", "branch.$branch.merge",  "refs/remotes/git-svn"); # XXX Assumes standard git-svn layout
+        }
+    }
+
     my $status = "";
     my ($fh, $ctx) = $repo->command_output_pipe('status');
     $status .= $_ while (<$fh>);
     eval {$repo->command_close_pipe($fh, $ctx);};
 
+    # Take the config back out
+    if ($gitsvn and $gitsvn < 0) {
+        my $branch = $repo->command("symbolic-ref", "HEAD"); chomp $branch;
+        $branch =~ s{refs/heads/(.*)}{$1};
+        $repo->command("config", "--remove-section", "branch.$branch");
+    }
+
     # Rebase if there are no changes, it is on a tracking
     # branch, and the result would be a fast-forward
     my ($branch) = $status =~ /^# On branch (.*)/m;
@@ -531,7 +549,7 @@ sub update {
 
         print logs($repo, $branch => $tracking);
 
-        my $pull = $pretend ? "" : `git pull --stat`;
+        my $pull = $pretend ? "" : $gitsvn ? `git merge --stat refs/remotes/git-svn` : `git pull --stat`;
         kill $? & 127, $$ if $? & 127; # Propagate the signal it died with, if any
 
         # This line will always be present, and is content-free

commit 1c7ca6f506b19366b451e213781eb431bdca50b0
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 10 18:00:34 2010 -0400

    Flesh out the gitignores

diff --git a/.gitignore b/.gitignore
index 6da21e6..329b7be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,7 @@
+META.yml
+Makefile
+Makefile.old
+blib
 inc
 nytprof
+pm_to_blib

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list