public
Description: Rubinius, the Ruby VM
Homepage: http://rubini.us
Clone URL: git://github.com/evanphx/rubinius.git
Make git rake tasks more sane
evanphx (author)
Tue Jul 15 17:00:42 -0700 2008
commit  2545a2853af8b3d29b24dc0b7615b9d2cf21af22
tree    2d700d8bb5fe1669962d557a64414374c6558264
parent  5c80fdfe147588644c56343ae3d55959f57f0af8
...
51
52
53
54
 
 
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 
 
 
 
 
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 
 
 
 
 
 
 
 
 
 
87
88
89
...
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
 
 
116
117
118
...
51
52
53
 
54
55
56
57
58
59
60
 
 
 
 
 
 
 
 
 
 
 
 
 
61
62
63
64
65
66
67
68
69
 
 
 
 
 
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
...
92
93
94
 
 
 
 
 
 
 
 
 
95
 
 
 
 
 
 
 
 
 
96
97
98
99
100
0
@@ -51,39 +51,37 @@ namespace :git do
0
     if name.strip.empty?
0
       name = default
0
     end
0
- sh "git checkout -b #{name}"
0
+ sh "git branch --track #{name}"
0
+ sh "git checkout #{name}"
0
   end
0
 
0
   desc "Push all changes to the rubinius repository"
0
   task :push => :update do
0
     branch = git_branch()
0
- if branch != "master"
0
- `git diff-files --quiet`
0
- if $?.exitstatus == 1
0
- puts "You have outstanding changes. Please commit them first."
0
- exit 1
0
- end
0
-
0
- puts "* Merging topic '#{branch}' back into master..."
0
- `git checkout master`
0
- sh "git merge #{branch}"
0
- switch = true
0
- else
0
- switch = false
0
+
0
+ rem = `git config branch.#{branch}.remote`.strip
0
+ if $?.exitstatus == 1
0
+ puts "This branch does not have tracking setup, so I'm unable to automatically pull into it. Please use 'rake git:topic' or 'git branch --track' to create your topic branches."
0
+ exit 1
0
     end
0
 
0
     puts "* Pushing changes..."
0
     sh "git push"
0
-
0
- if switch
0
- puts "* Switching back to #{branch}..."
0
- `git checkout #{branch}`
0
- end
0
   end
0
 
0
   desc "Pull new commits from the rubinius repository"
0
   task :update do
0
     check_git_ver
0
+ branch = git_branch()
0
+
0
+ # Test if this is a "root" branch or a topic branch.
0
+
0
+ rem = `git config branch.#{branch}.remote`.strip
0
+ if $?.exitstatus == 1
0
+ puts "This branch does not have tracking setup, so I'm unable to automatically pull into it. Please use 'rake git:topic' or 'git branch --track' to create your topic branches."
0
+ exit 1
0
+ end
0
+
0
     `git diff-files --quiet`
0
     if $?.exitstatus == 1
0
       stash = true
0
@@ -94,25 +92,9 @@ namespace :git do
0
       stash = false
0
     end
0
 
0
- branch = git_branch()
0
- if branch != "master"
0
- switch = true
0
- `git checkout master`
0
- puts "* Switching back to master..."
0
- else
0
- switch = false
0
- end
0
-
0
     puts "* Pulling in new commits..."
0
- sh "git fetch"
0
- sh "git rebase origin"
0
-
0
- if switch
0
- puts "* Porting changes into #{branch}..."
0
- `git checkout #{branch}`
0
- sh "git rebase master"
0
- end
0
-
0
+ sh "git pull --rebase"
0
+
0
     if stash
0
       puts "* Applying changes..."
0
       sh "git stash apply"

Comments

    No one has commented yet.