git 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of git might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 892ebb66d9ea20f8ab3f3050b53b1b06bbfc25b732367ffc89d8b9abc0f9d960
4
- data.tar.gz: a980be3464e4dcac4fed077a8fe72a120641a788f99947bedd7b4a0644255ab0
3
+ metadata.gz: 86d44aad4d6c430e5e224d27ddfece08f6a5696c068dbe041df3bd740ae94d7a
4
+ data.tar.gz: d7ac8d85b906620006cb5c1fc9206d6f406115490b88fedc7fb8aebe4a8302c9
5
5
  SHA512:
6
- metadata.gz: 280443c1f27cfe14b6ac5db700a28111943e76cee25ceef42d0d18fb6fa5cc536c6f5edf66057cc7b5e602c58e97c541f4f3d226306e80c004cdebad2d4448fa
7
- data.tar.gz: e0824c1c2874240848147b57906c811e5f74ee3f8cfd7b5d11361cb35abc6ecf86cb33b61cacc3107ee46706c103259579bccfe68dd1eca252d4629d74871ce4
6
+ metadata.gz: 19d5093d80ee3a4af8c6ceb27185464378a715330de92893cd81ece19a71986e29f7631c389b7204eb2bb4a47b0dcc8ce56f3a90164a6f2a22b696d53c6e8179
7
+ data.tar.gz: 29895e438fec3de810e1b3f78bf2c177b04081a72fdfad72a3e231ee3737df23e6cbebb58678a81c9883bcbb05b29058bee9c4c6189dcdac21249e8ac5bd0959
@@ -1,13 +1,23 @@
1
- == 1.3.0
1
+ # Change Log
2
+
3
+ ## 1.5.0
4
+
5
+ See https://github.com/ruby-git/ruby-git/releases/tag/v1.5.0
6
+
7
+ ## 1.4.0
8
+
9
+ See https://github.com/ruby-git/ruby-git/releases/tag/v1.4.0
10
+
11
+ ## 1.3.0
2
12
 
3
13
  * Dropping Ruby 1.8.x support
4
14
 
5
- == 1.2.10
15
+ ## 1.2.10
6
16
 
7
17
  * Adding Git::Diff.name_status
8
18
  * Checking and fixing encoding on commands output to prevent encoding errors afterwards
9
19
 
10
- == 1.2.9
20
+ ## 1.2.9
11
21
 
12
22
  * Adding Git.configure (to configure the git env)
13
23
  * Adding Git.ls_remote [Git.ls_remote(repo_path_or_url='.')]
@@ -27,13 +37,13 @@
27
37
  * Git.fetch - supporting --prune
28
38
  * Git.tag - supporting
29
39
 
30
- == 1.2.8
40
+ ## 1.2.8
31
41
 
32
42
  * Keeping the old escape format for windows users
33
43
  * revparse: Supporting ref names containing SHA like substrings (40-hex strings)
34
44
  * Fix warnings on Ruby 2.1.2
35
45
 
36
- == 1.2.7
46
+ ## 1.2.7
37
47
 
38
48
  * Fixing mesages encoding
39
49
  * Fixing -f flag in git push
@@ -45,7 +55,7 @@
45
55
  * Git.add_tag options - supporting -a, -m and -s
46
56
  * Added Git.delete_tag
47
57
 
48
- == 1.2.6
58
+ ## 1.2.6
49
59
 
50
60
  * Ruby 1.9.X/2.0 fully supported
51
61
  * JRuby 1.8/1.9 support
@@ -61,12 +71,12 @@
61
71
  * Travis configuration
62
72
  * Licence included with the gem
63
73
 
64
- == 1.0.4
74
+ ## 1.0.4
65
75
 
66
76
  * added camping/gitweb.rb frontend
67
77
  * added a number of speed-ups
68
78
 
69
- == 1.0.3
79
+ ## 1.0.3
70
80
 
71
81
  * Sped up most of the operations
72
82
  * Added some predicate functions (commit?, tree?, etc)
@@ -74,11 +84,11 @@
74
84
  * Fixed a bug with using bare repositories
75
85
  * Updated a good amount of the documentation
76
86
 
77
- == 1.0.2
87
+ ## 1.0.2
78
88
 
79
89
  * Added methods to the git objects that might be helpful
80
90
 
81
- == 1.0.1
91
+ ## 1.0.1
82
92
 
83
93
  * Initial version
84
94
 
@@ -0,0 +1,94 @@
1
+ # Contributing to ruby-git
2
+
3
+ Thank you for your interest in contributing to this project.
4
+
5
+ These are mostly guidelines, not rules.
6
+ Use your best judgment, and feel free to propose changes to this document in a pull request.
7
+
8
+ #### Table Of Contents
9
+
10
+ [How Can I Contribute?](#how-can-i-contribute)
11
+ * [Submitting Issues](#submitting-issues)
12
+ * [Contribution Process](#contribution-process)
13
+ * [Pull Request Requirements](#pull-request-requirements)
14
+ * [Code Review Process](#code-review-process)
15
+ * [Developer Certification of Origin (DCO)](#developer-certification-of-origin-dco)
16
+
17
+
18
+ ## How Can I Contribute?
19
+
20
+ ### Submitting Issues
21
+
22
+ We utilize **GitHub Issues** for issue tracking and contributions. You can contribute in two ways:
23
+
24
+ 1. Reporting an issue or making a feature request [here](https://github.com/ruby-git/ruby-git/issues/new).
25
+ 2. Adding features or fixing bugs yourself and contributing your code to ruby-git.
26
+
27
+ ### Contribution Process
28
+
29
+ We have a 3 step process for contributions:
30
+
31
+ 1. Commit changes to a git branch in your fork. Making sure to sign-off those changes for the [Developer Certificate of Origin](#developer-certification-of-origin-dco).
32
+ 2. Create a GitHub Pull Request for your change, following the instructions in the pull request template.
33
+ 3. Perform a [Code Review](#code-review-process) with the project maintainers on the pull request.
34
+
35
+ ### Pull Request Requirements
36
+ In order to ensure high quality, we require that all pull requests to this project meet these specifications:
37
+
38
+ 1. Unit Testing: We require all the new code to include unit tests, and any fixes to pass previous units.
39
+ 2. Green CI Tests: We are using [Travis CI](https://travis-ci.org/ruby-git/ruby-git) to run unit tests on various ruby versions, we expect them to all pass before a pull request will be merged.
40
+ 3. Up-to-date Documentation: New methods as well as updated methods should have [YARD](https://yardoc.org/) documentation added to them
41
+
42
+ ### Code Review Process
43
+
44
+ Code review takes place in GitHub pull requests. See [this article](https://help.github.com/articles/about-pull-requests/) if you're not familiar with GitHub Pull Requests.
45
+
46
+ Once you open a pull request, project maintainers will review your code and respond to your pull request with any feedback they might have.
47
+
48
+ The process at this point is as follows:
49
+
50
+ 1. One thumbs-up (:+1:) is required from project maintainers. See the master maintainers document for the ruby-git project at <https://github.com/ruby-git/ruby-git/blob/master/MAINTAINERS.md>.
51
+ 2. When ready, your pull request will be merged into `master`, we may require you to rebase your PR to the latest `master`.
52
+
53
+ ### Developer Certification of Origin (DCO)
54
+
55
+ Licensing is very important to open source projects. It helps ensure the software continues to be available under the terms that the author desired.
56
+
57
+ ruby-git uses [the MIT license](https://github.com/ruby-git/ruby-git/blob/master/LICENSE)
58
+
59
+ Detail about the LICENSE can be found [here](https://choosealicense.com/licenses/mit/)
60
+
61
+ To make a good faith effort to ensure these criteria are met, ruby-git requires the Developer Certificate of Origin (DCO) process to be followed.
62
+
63
+ The DCO is an attestation attached to every contribution made by every developer.
64
+
65
+ In the commit message of the contribution, the developer simply adds a Signed-off-by statement and thereby agrees to the DCO, which you can find below or at <http://developercertificate.org/>.
66
+
67
+ ```
68
+ Developer's Certificate of Origin 1.1
69
+
70
+ By making a contribution to this project, I certify that:
71
+
72
+ (a) The contribution was created in whole or in part by me and I
73
+ have the right to submit it under the open source license
74
+ indicated in the file; or
75
+
76
+ (b) The contribution is based upon previous work that, to the
77
+ best of my knowledge, is covered under an appropriate open
78
+ source license and I have the right under that license to
79
+ submit that work with modifications, whether created in whole
80
+ or in part by me, under the same open source license (unless
81
+ I am permitted to submit under a different license), as
82
+ Indicated in the file; or
83
+
84
+ (c) The contribution was provided directly to me by some other
85
+ person who certified (a), (b) or (c) and I have not modified
86
+ it.
87
+
88
+ (d) I understand and agree that this project and the contribution
89
+ are public and that a record of the contribution (including
90
+ all personal information I submit with it, including my
91
+ sign-off) is maintained indefinitely and may be redistributed
92
+ consistent with this project or the open source license(s)
93
+ involved.
94
+ ```
@@ -0,0 +1,8 @@
1
+ # Maintainers
2
+
3
+ When making changes to the system, this file tells you who needs to review your patch - you need at least two maintainers to provide a :+1: on your pull request.
4
+
5
+ ### Maintainers
6
+
7
+ * [Per Lundberg](https://github.com/perlun)
8
+ * [Vern Burton](https://github.com/tarcinil)
data/README.md CHANGED
@@ -202,6 +202,7 @@ And here are the operations that will need to write to your git repository.
202
202
  g.branch('new_branch').checkout
203
203
  g.branch('new_branch').delete
204
204
  g.branch('existing_branch').checkout
205
+ g.branch('master').contains?('existing_branch')
205
206
 
206
207
  g.checkout('new_branch')
207
208
  g.checkout(g.branch('new_branch'))
@@ -226,6 +227,7 @@ And here are the operations that will need to write to your git repository.
226
227
 
227
228
  g.fetch
228
229
  g.fetch(g.remotes.first)
230
+ g.fetch('origin', {:ref => 'some/ref/head'} )
229
231
 
230
232
  g.pull
231
233
  g.pull(Git::Repo, Git::Branch) # fetch and a merge
@@ -60,6 +60,10 @@ module Git
60
60
  determine_current
61
61
  end
62
62
 
63
+ def contains?(commit)
64
+ !@base.lib.branch_contains(commit, self.name).empty?
65
+ end
66
+
63
67
  def merge(branch = nil, message = nil)
64
68
  if branch
65
69
  in_branch do
@@ -127,10 +127,11 @@ module Git
127
127
  }
128
128
  final = {}
129
129
  current_file = nil
130
- full_diff_utf8_encoded = @full_diff.encode("UTF-8", "binary", {
131
- :invalid => :replace,
132
- :undef => :replace
133
- })
130
+ if @full_diff.encoding.name != "UTF-8"
131
+ full_diff_utf8_encoded = @full_diff.encode("UTF-8", "binary", { :invalid => :replace, :undef => :replace })
132
+ else
133
+ full_diff_utf8_encoded = @full_diff
134
+ end
134
135
  full_diff_utf8_encoded.split("\n").each do |line|
135
136
  if m = /^diff --git a\/(.*?) b\/(.*?)/.match(line)
136
137
  current_file = m[1]
@@ -318,6 +318,9 @@ module Git
318
318
  branches_all.select { |b| b[1] }.first[0] rescue nil
319
319
  end
320
320
 
321
+ def branch_contains(commit, branch_name="")
322
+ command("branch", [branch_name, "--contains", commit])
323
+ end
321
324
 
322
325
  # returns hash
323
326
  # [tree-ish] = [[line_no, match], [line_no, match2]]
@@ -445,7 +448,7 @@ module Git
445
448
  if @git_dir
446
449
  Dir.chdir(@git_dir, &do_get)
447
450
  else
448
- build_list.call
451
+ do_get.call
449
452
  end
450
453
  end
451
454
 
@@ -553,6 +556,7 @@ module Git
553
556
  arr_opts << '--all' if opts[:add_all] || opts[:all]
554
557
  arr_opts << '--allow-empty' if opts[:allow_empty]
555
558
  arr_opts << "--author=#{opts[:author]}" if opts[:author]
559
+ arr_opts << "--date=#{opts[:date]}" if opts[:date].is_a? String
556
560
 
557
561
  command('commit', arr_opts)
558
562
  end
@@ -600,10 +604,12 @@ module Git
600
604
  arr = []
601
605
  filename = File.join(@git_dir, 'logs/refs/stash')
602
606
  if File.exist?(filename)
603
- File.open(filename).each_with_index { |line, i|
604
- m = line.match(/:(.*)$/)
605
- arr << [i, m[1].strip]
606
- }
607
+ File.open(filename) do |f|
608
+ f.each_with_index do |line, i|
609
+ m = line.match(/:(.*)$/)
610
+ arr << [i, m[1].strip]
611
+ end
612
+ end
607
613
  end
608
614
  arr
609
615
  end
@@ -727,7 +733,10 @@ module Git
727
733
  arr_opts << '-d' if opts[:d] || opts[:delete]
728
734
  arr_opts << name
729
735
  arr_opts << target if target
730
- arr_opts << "-m #{opts[:m] || opts[:message]}" if opts[:m] || opts[:message]
736
+
737
+ if opts[:m] || opts[:message]
738
+ arr_opts << '-m' << (opts[:m] || opts[:message])
739
+ end
731
740
 
732
741
  command('tag', arr_opts)
733
742
  end
@@ -735,6 +744,7 @@ module Git
735
744
 
736
745
  def fetch(remote, opts)
737
746
  arr_opts = [remote]
747
+ arr_opts << opts[:ref] if opts[:ref]
738
748
  arr_opts << '--tags' if opts[:t] || opts[:tags]
739
749
  arr_opts << '--prune' if opts[:p] || opts[:prune]
740
750
 
@@ -747,6 +757,7 @@ module Git
747
757
 
748
758
  arr_opts = []
749
759
  arr_opts << '--mirror' if opts[:mirror]
760
+ arr_opts << '--delete' if opts[:delete]
750
761
  arr_opts << '--force' if opts[:force] || opts[:f]
751
762
  arr_opts << remote
752
763
 
@@ -13,6 +13,17 @@ module Git
13
13
  @stashes.unshift(Git::Stash.new(@base, message, true))
14
14
  end
15
15
  end
16
+
17
+ #
18
+ # Returns an multi-dimensional Array of elements that have been stash saved.
19
+ # Array is based on position and name. See Example
20
+ #
21
+ # @example Returns Array of items that have been stashed
22
+ # .all - [0, "testing-stash-all"]]
23
+ # @return [Array]
24
+ def all
25
+ @base.lib.stashes_all
26
+ end
16
27
 
17
28
  def save(message)
18
29
  s = Git::Stash.new(@base, message)
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  # The current gem version
3
3
  # @return [String] the current gem version.
4
- VERSION='1.4.0'
4
+ VERSION='1.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon and others
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2018-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -65,10 +65,11 @@ extensions: []
65
65
  extra_rdoc_files:
66
66
  - README.md
67
67
  files:
68
- - CHANGELOG
68
+ - CHANGELOG.md
69
+ - CONTRIBUTING.md
69
70
  - LICENSE
71
+ - MAINTAINERS.md
70
72
  - README.md
71
- - VERSION
72
73
  - lib/git.rb
73
74
  - lib/git/author.rb
74
75
  - lib/git/base.rb
data/VERSION DELETED
@@ -1,2 +0,0 @@
1
- 1.3.0
2
-