-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathgit-sync
More file actions
executable file
·38 lines (26 loc) · 1.13 KB
/
git-sync
File metadata and controls
executable file
·38 lines (26 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env ruby
#require "rubygems"
#require "bundler/setup"
#$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../lib')
require 'git-process/git_process_options'
require 'git-process/sync_process'
require 'git-process/git_lib'
class SyncOptions
include GitProc::GitProcessOptions
def extend_opts(parser)
parser.opt :rebase, "Rebase instead of merge against the integration branch (default: on)", :short => :r
parser.opt :merge, "Merge instead of rebase against the integration branch", :short => :m
parser.opt :force, "Force the push; defaults to true if --rebase is used", :short => :f, :default => false
parser.opt :local, "Do not do a push; gets remote changes, but does not update the server", :short => :l
parser.conflicts :rebase, :merge
parser.conflicts :local, :force
end
#noinspection RubyUnusedLocalVariable
def post_parse(opts, argv)
opts[:rebase] = true unless opts[:merge]
opts[:force] = true if opts[:rebase]
opts[:branch_name] = argv.shift
end
end
opts = SyncOptions.new.parse_cli(File.basename(__FILE__), ARGV)
GitProc::Sync.new(GitProc::GitLib.new('.', opts), opts).run