Class: Git::Lib

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/git_patch.rb

Instance Method Summary collapse

Instance Method Details

#command_lines_patch(command, opt = [], chdir = true, redirect = '') ⇒ Object



27
28
29
# File 'lib/core_ext/git_patch.rb', line 27

def command_lines_patch(command,opt = [],chdir = true,redirect = '')
	command_lines(command,opt,chdir,redirect)
end

#full_log_commits(opts = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/core_ext/git_patch.rb', line 8

def full_log_commits(opts = {})
	# String的uncolorize没能生效,使用这个
	arr_opts = ['--no-color --pretty=raw']
	arr_opts << "-#{opts[:count]}" if opts[:count]
	arr_opts << "--skip=#{opts[:skip]}" if opts[:skip]
	arr_opts << "--since=#{opts[:since]}" if opts[:since].is_a? String
	arr_opts << "--until=#{opts[:until]}" if opts[:until].is_a? String
	arr_opts << "--grep=#{opts[:grep]}" if opts[:grep].is_a? String
	arr_opts << "--author=#{opts[:author]}" if opts[:author].is_a? String
	arr_opts << "#{opts[:between][0].to_s}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
	arr_opts << opts[:object] if opts[:object].is_a? String
	arr_opts << '--' << opts[:path_limiter] if opts[:path_limiter].is_a? String
	puts arr_opts.to_s_s

	full_log = command_lines('log', arr_opts, true)
	# modify by weizhao. commit must be specify
	# putsrocess_commit_data(full_log)
	process_commit_data(full_log,"commit")
end