Skip to content

Commit 2e1ffba

Browse files
committed
Merge branch 'master' of github.com:schacon/ruby-git
2 parents a8b5bd7 + 14738bb commit 2e1ffba

38 files changed

+802
-267
lines changed

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ rvm:
44
- 1.9.2
55
- 1.9.3
66
- 2.0.0
7+
- 2.1.1
8+
- 2.1.2
79
- jruby-18mode
810
- jruby-19mode
9-
- jruby-head
10-
# - rbx-18mode
11-
# - rbx-19mode
1211
- ree
1312
matrix:
1413
allow_failures:

CHANGELOG

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
== 1.2.9
2+
3+
* Adding Git.configure (to configure the git env)
4+
* Adding Git.ls_remote [Git.ls_remote(repo_path_or_url='.')]
5+
* Adding Git.describe [repo.describe(objectish, opts)]
6+
* Adding Git.show [repo.show(objectish=nil, path=nil)]
7+
* Fixing Git::Diff to support default references (implicit references)
8+
* Fixing Git::Diff to support diff over git .patch files
9+
* Fixing Git.checkout when using :new_branch opt
10+
* Fixing Git::Object::Commit to preserve its sha after fetching metadata
11+
* Fixing Git.is_remote_branch? to actually check against remote branches
12+
* Improvements over how ENV variables are modified
13+
* Improving thrade safety (using --git-dir and --work-tree git opts)
14+
* Improving Git::Object::Tag. Adding annotated?, tagger and message
15+
* Supporting a submodule path as a valid repo
16+
* Git.checkout - supporting -f and -b
17+
* Git.clone - supporting --branch
18+
* Git.fetch - supporting --prune
19+
* Git.tag - supporting
20+
21+
== 1.2.8
22+
23+
* Keeping the old escape format for windows users
24+
* revparse: Supporting ref names containing SHA like substrings (40-hex strings)
25+
* Fix warnings on Ruby 2.1.2
26+
27+
== 1.2.7
28+
29+
* Fixing mesages encoding
30+
* Fixing -f flag in git push
31+
* Fixing log parser for multiline messages
32+
* Supporting object references on Git.add_tag
33+
* Including dotfiles on Git.status
34+
* Git.fetch - supporting --tags
35+
* Git.clean - supporting -x
36+
* Git.add_tag options - supporting -a, -m and -s
37+
* Added Git.delete_tag
38+
39+
== 1.2.6
40+
41+
* Ruby 1.9.X/2.0 fully supported
42+
* JRuby 1.8/1.9 support
43+
* Rubinius support
44+
* Git.clone - supporting --recursive and --config
45+
* Git.log - supporting last and [] over the results
46+
* Git.add_remote - supporting -f and -t
47+
* Git.add - supporting --fore
48+
* Git.init - supporting --bare
49+
* Git.commit - supporting --all and --amend
50+
* Added Git.remote_remote, Git.revert and Git.clean
51+
* Added Bundler to the formula
52+
* Travis configuration
53+
* Licence included with the gem
54+
55+
== 1.0.4
56+
57+
* added camping/gitweb.rb frontend
58+
* added a number of speed-ups
59+
60+
== 1.0.3
61+
62+
* Sped up most of the operations
63+
* Added some predicate functions (commit?, tree?, etc)
64+
* Added a number of lower level operations (read-tree, write-tree, checkout-index, etc)
65+
* Fixed a bug with using bare repositories
66+
* Updated a good amount of the documentation
67+
68+
== 1.0.2
69+
70+
* Added methods to the git objects that might be helpful
71+
72+
== 1.0.1
73+
74+
* Initial version
75+

History.txt

-37
This file was deleted.

README.md

+29-3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ Require the 'git' gem.
5757
require 'git'
5858
```
5959

60+
Git env config
61+
62+
```ruby
63+
Git.configure do |config|
64+
# If you want to use a custom git binary
65+
config.binary_path = '/git/bin/path'
66+
67+
# If you need to use a custom SSH script
68+
config.git_ssh = '/path/to/ssh/script'
69+
end
70+
71+
```
72+
73+
6074
Here are the operations that need read permission only.
6175

6276
```ruby
@@ -113,7 +127,10 @@ Here are the operations that need read permission only.
113127
g.grep('hello') # implies HEAD
114128
g.blob('v2.5:Makefile').grep('hello')
115129
g.tag('v2.5').grep('hello', 'docs/')
116-
130+
g.describe()
131+
g.describe('0djf2aa')
132+
g.describe('HEAD', {:all => true, :tags => true})
133+
117134
g.diff(commit1, commit2).size
118135
g.diff(commit1, commit2).stats
119136
g.gtree('v2.5').diff('v2.6').insertions
@@ -132,6 +149,15 @@ Here are the operations that need read permission only.
132149
g.config # returns whole config hash
133150

134151
g.tags # returns array of Git::Tag objects
152+
153+
g.show()
154+
g.show('HEAD')
155+
g.show('v2.8', 'README.md')
156+
157+
Git.ls_remote('https://github.com/schacon/ruby-git.git') # returns a hash containing the available references of the repo.
158+
Git.ls_remote('/path/to/local/repo')
159+
Git.ls_remote() # same as Git.ls_remote('.')
160+
135161
```
136162

137163
And here are the operations that will need to write to your git repository.
@@ -140,8 +166,8 @@ And here are the operations that will need to write to your git repository.
140166
g = Git.init
141167
Git.init('project')
142168
Git.init('/home/schacon/proj',
143-
{ :git_dir => '/opt/git/proj.git',
144-
:index_file => '/tmp/index'} )
169+
{ :repository => '/opt/git/proj.git',
170+
:index => '/tmp/index'} )
145171

146172
g = Git.clone(URI, NAME, :path => '/tmp/checkout')
147173
g.config('user.name', 'Scott Chacon')

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.6
1+
1.2.9.1

git.gemspec

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
1-
require 'date'
2-
3-
require "#{File.expand_path(File.dirname(__FILE__))}/lib/git/version"
4-
51
Gem::Specification.new do |s|
62
s.authors = ['Scott Chacon']
7-
s.date = Date.today.to_s
3+
s.date = '2015-01-13'
84
s.email = '[email protected]'
95
s.homepage = 'http://github.com/schacon/ruby-git'
106
s.license = 'MIT'
117
s.name = 'git'
128
s.summary = 'Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary.'
13-
s.version = Git::VERSION
9+
s.version = '1.2.9.1'
1410

1511
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
1612
s.require_paths = ['lib']
1713
s.requirements = ['git 1.6.0.0, or greater']
1814

1915
s.add_development_dependency 'rake'
2016
s.add_development_dependency 'rdoc'
21-
s.add_development_dependency 'test-unit'
17+
s.add_development_dependency 'test-unit', '>=2', '< 4'
2218

2319
s.extra_rdoc_files = ['README.md']
2420
s.rdoc_options = ['--charset=UTF-8']
2521

2622
s.files = [
23+
'CHANGELOG',
2724
'LICENSE',
25+
'README.md',
26+
'VERSION',
2827
'lib/git.rb',
2928
'lib/git/author.rb',
3029
'lib/git/base.rb',
30+
'lib/git/base/factory.rb',
3131
'lib/git/branch.rb',
3232
'lib/git/branches.rb',
33+
'lib/git/config.rb',
3334
'lib/git/diff.rb',
3435
'lib/git/index.rb',
3536
'lib/git/lib.rb',

lib/git.rb

+18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
require 'git/base'
88
require 'git/branch'
99
require 'git/branches'
10+
require 'git/config'
1011
require 'git/diff'
1112
require 'git/index'
1213
require 'git/lib'
@@ -60,6 +61,14 @@ def config(name = nil, value = nil)
6061
end
6162
end
6263

64+
def self.configure
65+
yield Base.config
66+
end
67+
68+
def self.config
69+
return Base.config
70+
end
71+
6372
def global_config(name = nil, value = nil)
6473
self.class.global_config(name, value)
6574
end
@@ -130,6 +139,15 @@ def self.global_config(name = nil, value = nil)
130139
def self.init(working_dir = '.', options = {})
131140
Base.init(working_dir, options)
132141
end
142+
143+
# returns a Hash containing information about the references
144+
# of the target repository
145+
#
146+
# @param [String|NilClass] location the target repository location or nil for '.'
147+
# @return [{String=>Hash}] the available references of the target repo.
148+
def self.ls_remote(location=nil)
149+
Git::Lib.new.ls_remote(location)
150+
end
133151

134152
# open an existing git working directory
135153
#

lib/git/author.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ def initialize(author_string)
1111
end
1212

1313
end
14-
end
14+
end

0 commit comments

Comments
 (0)