From 4aa6d1f0db40488e657b92be68696fdf5451109f Mon Sep 17 00:00:00 2001 From: Vern Burton Date: Wed, 20 Jun 2018 06:58:17 -0500 Subject: [PATCH 01/12] Creates CONTRIBUTOR and MAINTAINERS files (#353) * * moving CHANGELOG to markdown to get benefits of the format that it is written in * adding CONTRIBUTING and MAINTAINERS markdown file based on projects that I have worked it (discussion still open for final) * adding new files and extension to gemspec Signed-off-by: Vern Burton * fixing dco anchor Signed-off-by: Vern Burton * using markdown formats Signed-off-by: Vern Burton * adding pull request requirements and license information Signed-off-by: Vern Burton * adding github templates for issues/pull requests Signed-off-by: Vern Burton * fixing comments to PR * updating Github to GitHub * completing sentence for DCO signoff Signed-off-by: Vern Burton --- CHANGELOG => CHANGELOG.md | 22 ++++----- CONTRIBUTING.md | 94 +++++++++++++++++++++++++++++++++++++++ ISSUE_TEMPLATE.md | 15 +++++++ MAINTAINERS.md | 8 ++++ PULL_REQUEST_TEMPLATE.md | 9 ++++ git.gemspec | 4 +- 6 files changed, 141 insertions(+), 11 deletions(-) rename CHANGELOG => CHANGELOG.md (95%) create mode 100644 CONTRIBUTING.md create mode 100644 ISSUE_TEMPLATE.md create mode 100644 MAINTAINERS.md create mode 100644 PULL_REQUEST_TEMPLATE.md diff --git a/CHANGELOG b/CHANGELOG.md similarity index 95% rename from CHANGELOG rename to CHANGELOG.md index 78dff72c..5f780d64 100644 --- a/CHANGELOG +++ b/CHANGELOG.md @@ -1,13 +1,15 @@ -== 1.3.0 +# Change Log + +## 1.3.0 * Dropping Ruby 1.8.x support -== 1.2.10 +## 1.2.10 * Adding Git::Diff.name_status * Checking and fixing encoding on commands output to prevent encoding errors afterwards -== 1.2.9 +## 1.2.9 * Adding Git.configure (to configure the git env) * Adding Git.ls_remote [Git.ls_remote(repo_path_or_url='.')] @@ -27,13 +29,13 @@ * Git.fetch - supporting --prune * Git.tag - supporting -== 1.2.8 +## 1.2.8 * Keeping the old escape format for windows users * revparse: Supporting ref names containing SHA like substrings (40-hex strings) * Fix warnings on Ruby 2.1.2 -== 1.2.7 +## 1.2.7 * Fixing mesages encoding * Fixing -f flag in git push @@ -45,7 +47,7 @@ * Git.add_tag options - supporting -a, -m and -s * Added Git.delete_tag -== 1.2.6 +## 1.2.6 * Ruby 1.9.X/2.0 fully supported * JRuby 1.8/1.9 support @@ -61,12 +63,12 @@ * Travis configuration * Licence included with the gem -== 1.0.4 +## 1.0.4 * added camping/gitweb.rb frontend * added a number of speed-ups -== 1.0.3 +## 1.0.3 * Sped up most of the operations * Added some predicate functions (commit?, tree?, etc) @@ -74,11 +76,11 @@ * Fixed a bug with using bare repositories * Updated a good amount of the documentation -== 1.0.2 +## 1.0.2 * Added methods to the git objects that might be helpful -== 1.0.1 +## 1.0.1 * Initial version diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..5b97cdca --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,94 @@ +# Contributing to ruby-git + +Thank you for your interest in contributing to this project. + +These are mostly guidelines, not rules. +Use your best judgment, and feel free to propose changes to this document in a pull request. + +#### Table Of Contents + +[How Can I Contribute?](#how-can-i-contribute) + * [Submitting Issues](#submitting-issues) + * [Contribution Process](#contribution-process) + * [Pull Request Requirements](#pull-request-requirements) + * [Code Review Process](#code-review-process) + * [Developer Certification of Origin (DCO)](#developer-certification-of-origin-dco) + + +## How Can I Contribute? + +### Submitting Issues + +We utilize **GitHub Issues** for issue tracking and contributions. You can contribute in two ways: + +1. Reporting an issue or making a feature request [here](https://github.com/ruby-git/ruby-git/issues/new). +2. Adding features or fixing bugs yourself and contributing your code to ruby-git. + +### Contribution Process + +We have a 3 step process for contributions: + +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). +2. Create a GitHub Pull Request for your change, following the instructions in the pull request template. +3. Perform a [Code Review](#code-review-process) with the project maintainers on the pull request. + +### Pull Request Requirements +In order to ensure high quality, we require that all pull requests to this project meet these specifications: + +1. Unit Testing: We require all the new code to include unit tests, and any fixes to pass previous units. +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. +3. Up-to-date Documentation: New methods as well as updated methods should have [YARD](https://yardoc.org/) documentation added to them + +### Code Review Process + +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. + +Once you open a pull request, project maintainers will review your code and respond to your pull request with any feedback they might have. + +The process at this point is as follows: + +1. One thumbs-up (:+1:) is required from project maintainers. See the master maintainers document for the ruby-git project at . +2. When ready, your pull request will be merged into `master`, we may require you to rebase your PR to the latest `master`. + +### Developer Certification of Origin (DCO) + +Licensing is very important to open source projects. It helps ensure the software continues to be available under the terms that the author desired. + +ruby-git uses [the MIT license](https://github.com/ruby-git/ruby-git/blob/master/LICENSE) + +Detail about the LICENSE can be found [here](https://choosealicense.com/licenses/mit/) + +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. + +The DCO is an attestation attached to every contribution made by every developer. + +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 . + +``` +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the + best of my knowledge, is covered under an appropriate open + source license and I have the right under that license to + submit that work with modifications, whether created in whole + or in part by me, under the same open source license (unless + I am permitted to submit under a different license), as + Indicated in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including + all personal information I submit with it, including my + sign-off) is maintained indefinitely and may be redistributed + consistent with this project or the open source license(s) + involved. +``` diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..dd4fc23c --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,15 @@ +### Subject of the issue +Describe your issue here. + +### Your environment +* version of git and ruby-git +* version of ruby + +### Steps to reproduce +Tell us how to reproduce this issue. + +### Expected behaviour +What did you expect to happen? + +### Actual behaviour +What actually happened? \ No newline at end of file diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 00000000..43b76f74 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,8 @@ +# Maintainers + +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. + +### Maintainers + +* [Per Lundberg](https://github.com/perlun) +* [Vern Burton](https://github.com/tarcinil) \ No newline at end of file diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..29510619 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +### Your checklist for this pull request +🚨Please review the [guidelines for contributing](../CONTRIBUTING.md) to this repository. + +- [ ] Ensure all commits include DCO sign-off. +- [ ] Ensure that your contributions pass unit testing. +- [ ] Ensure that your contributions contain documentation if applicable. + +### Description +Please describe your pull request. diff --git a/git.gemspec b/git.gemspec index bad8a496..75ef5a41 100644 --- a/git.gemspec +++ b/git.gemspec @@ -23,7 +23,9 @@ Gem::Specification.new do |s| s.rdoc_options = ['--charset=UTF-8'] s.files = [ - 'CHANGELOG', + 'CHANGELOG.md', + 'CONTRIBUTING.md', + 'MAINTAINERS.md', 'LICENSE', 'README.md', 'VERSION', From d1ab2c7a4c270e1a1ca0413c585762b75250a007 Mon Sep 17 00:00:00 2001 From: Denis Defreyne Date: Wed, 20 Jun 2018 14:02:19 +0200 Subject: [PATCH 02/12] Fix space prefix in tag message (#316) --- lib/git/lib.rb | 5 ++++- tests/units/test_tags.rb | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 17fe8f15..c0d0fd56 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -727,7 +727,10 @@ def tag(name, *opts) arr_opts << '-d' if opts[:d] || opts[:delete] arr_opts << name arr_opts << target if target - arr_opts << "-m #{opts[:m] || opts[:message]}" if opts[:m] || opts[:message] + + if opts[:m] || opts[:message] + arr_opts << '-m' << (opts[:m] || opts[:message]) + end command('tag', arr_opts) end diff --git a/tests/units/test_tags.rb b/tests/units/test_tags.rb index fde0683c..cbd707f8 100644 --- a/tests/units/test_tags.rb +++ b/tests/units/test_tags.rb @@ -65,12 +65,21 @@ def test_tags assert_equal(tag1.tagger.name, 'Test User') assert_equal(tag1.tagger.email, 'test@email.com') assert_true((Time.now - tag1.tagger.date) < 10) - assert_equal(tag1.message, ' test message') - + assert_equal(tag1.message, 'test message') + tag2 = r2.tag('fifth') assert_false(tag2.annotated?) assert_equal(tag2.tagger, nil) assert_equal(tag2.message, nil) end end + + def test_tag_message_not_prefixed_with_space + in_temp_dir do |path| + repo = Git.clone(@wbare, 'repo1') + repo.add_tag('donkey', :annotated => true, :message => 'hello') + tag = repo.tag('donkey') + assert_equal(tag.message, 'hello') + end + end end From e7f1880b41c798f65ce5e9c3f1c3854d8c3b10c9 Mon Sep 17 00:00:00 2001 From: Joshua Liebowitz Date: Mon, 25 Jun 2018 11:45:38 -0700 Subject: [PATCH 03/12] Allow fetch operation to receive a `ref` param (#362) * Allow fetch operation to receive a `ref` param addresses https://github.com/ruby-git/ruby-git/issues/361 * Update remote object * remove .ruby-version * Use options instead of separate param * Update for comments * Update for style --- README.md | 1 + lib/git/lib.rb | 1 + tests/units/test_remotes.rb | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 7dc5682c..87d1d5cf 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,7 @@ And here are the operations that will need to write to your git repository. g.fetch g.fetch(g.remotes.first) + g.fetch('origin', {:ref => 'some/ref/head'} ) g.pull g.pull(Git::Repo, Git::Branch) # fetch and a merge diff --git a/lib/git/lib.rb b/lib/git/lib.rb index c0d0fd56..0b3307fc 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -738,6 +738,7 @@ def tag(name, *opts) def fetch(remote, opts) arr_opts = [remote] + arr_opts << opts[:ref] if opts[:ref] arr_opts << '--tags' if opts[:t] || opts[:tags] arr_opts << '--prune' if opts[:p] || opts[:prune] diff --git a/tests/units/test_remotes.rb b/tests/units/test_remotes.rb index 1b9a7892..3e90c3b5 100644 --- a/tests/units/test_remotes.rb +++ b/tests/units/test_remotes.rb @@ -122,6 +122,34 @@ def test_fetch assert(loc.tags.map(&:name).include?('test-tag-in-deleted-branch')) end end + + def test_fetch_ref_adds_ref_option + in_temp_dir do |path| + loc = Git.clone(@wbare, 'local') + rem = Git.clone(@wbare, 'remote', :config => 'receive.denyCurrentBranch=ignore') + loc.add_remote('testrem', rem) + + loc.chdir do + new_file('test-file1', 'gonnaCommitYou') + loc.add + loc.commit('master commit 1') + first_commit_sha = loc.log.first.sha + + new_file('test-file2', 'gonnaCommitYouToo') + loc.add + loc.commit('master commit 2') + second_commit_sha = loc.log.first.sha + + # Make sure fetch message only has the first commit when we fetch the first commit + assert(loc.fetch('origin', {:ref => first_commit_sha}).include?(first_commit_sha)) + assert(!loc.fetch('origin', {:ref => first_commit_sha}).include?(second_commit_sha)) + + # Make sure fetch message only has the second commit when we fetch the second commit + assert(loc.fetch('origin', {:ref => second_commit_sha}).include?(second_commit_sha)) + assert(!loc.fetch('origin', {:ref => second_commit_sha}).include?(first_commit_sha)) + end + end + end def test_push in_temp_dir do |path| From 4435e0830d443ab65003568c8d84cb05e2163511 Mon Sep 17 00:00:00 2001 From: Joshua Liebowitz Date: Mon, 25 Jun 2018 11:46:53 -0700 Subject: [PATCH 04/12] config_get: Fix incorrect block name (#373) Signed-off-by: Joshua Liebowitz --- lib/git/lib.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 0b3307fc..813b6755 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -445,7 +445,7 @@ def config_get(name) if @git_dir Dir.chdir(@git_dir, &do_get) else - build_list.call + do_get.call end end From d5b0ec0212ee62984c10e8b2bb9ea42733776594 Mon Sep 17 00:00:00 2001 From: Taichiro Suzuki Date: Tue, 26 Jun 2018 04:23:21 +0900 Subject: [PATCH 05/12] process_full_diff: Don't reencode diffs which are already UTF-8 (#369) --- lib/git/diff.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/git/diff.rb b/lib/git/diff.rb index 19da0e92..ff819be0 100644 --- a/lib/git/diff.rb +++ b/lib/git/diff.rb @@ -127,10 +127,11 @@ def process_full_diff } final = {} current_file = nil - full_diff_utf8_encoded = @full_diff.encode("UTF-8", "binary", { - :invalid => :replace, - :undef => :replace - }) + if @full_diff.encoding.name != "UTF-8" + full_diff_utf8_encoded = @full_diff.encode("UTF-8", "binary", { :invalid => :replace, :undef => :replace }) + else + full_diff_utf8_encoded = @full_diff + end full_diff_utf8_encoded.split("\n").each do |line| if m = /^diff --git a\/(.*?) b\/(.*?)/.match(line) current_file = m[1] From 27715e9ed79eceb6b301ef05d0f096ec1acdda8d Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 6 Jul 2018 23:12:24 +0300 Subject: [PATCH 06/12] .travis.yml: Update supported Ruby versions (#371) - Drop 1.9, 2.0 and 2.1 which are EOL - Update 2.3, 2.4 and 2.5 specifiers (only specify minor version, not patch level) - Update JRuby to use latest and greatest Signed-off-by: Per Lundberg --- .travis.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3db3cb76..fc1c7b13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,12 @@ language: ruby rvm: - - 1.9.3 - - 2.0.0 - - 2.1.10 - - 2.3.4 - - 2.4.3 - - 2.5.0 - - jruby-9.1.15.0 + - 2.3 + - 2.4 + - 2.5 + - jruby matrix: allow_failures: - - rvm: jruby-9.1.15.0 + - rvm: jruby fast_finish: true before_install: - gem install bundler From 3bbf612dd326ccd74df182364fc159bc91c4bf1c Mon Sep 17 00:00:00 2001 From: Kelly Stannard Date: Thu, 12 Jul 2018 06:19:21 -0400 Subject: [PATCH 07/12] Check if branch contains commit (#174) This allows the user to see if an arbitrary commit is contained within a branch. For example you can check to see if a branch was merged into master with `git.branch('master').contains?('feature')`. Or you can see if your feature branch has the latest master commit with `git.branch('feature').contains?('master')` --- README.md | 1 + lib/git/branch.rb | 4 ++++ lib/git/lib.rb | 3 +++ tests/units/test_branch.rb | 8 ++++++++ 4 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 87d1d5cf..286e355e 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ And here are the operations that will need to write to your git repository. g.branch('new_branch').checkout g.branch('new_branch').delete g.branch('existing_branch').checkout + g.branch('master').contains?('existing_branch') g.checkout('new_branch') g.checkout(g.branch('new_branch')) diff --git a/lib/git/branch.rb b/lib/git/branch.rb index 4f69e0cd..17573af6 100644 --- a/lib/git/branch.rb +++ b/lib/git/branch.rb @@ -60,6 +60,10 @@ def current determine_current end + def contains?(commit) + !@base.lib.branch_contains(commit, self.name).empty? + end + def merge(branch = nil, message = nil) if branch in_branch do diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 813b6755..8f05f9b0 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -318,6 +318,9 @@ def branch_current branches_all.select { |b| b[1] }.first[0] rescue nil end + def branch_contains(commit, branch_name="") + command("branch", [branch_name, "--contains", commit]) + end # returns hash # [tree-ish] = [[line_no, match], [line_no, match2]] diff --git a/tests/units/test_branch.rb b/tests/units/test_branch.rb index fee70abc..8f83a6d9 100644 --- a/tests/units/test_branch.rb +++ b/tests/units/test_branch.rb @@ -44,6 +44,14 @@ def test_branches_single end end + def test_true_branch_contains? + assert(@git.branch('git_grep').contains?('master')) + end + + def test_false_branch_contains? + assert(!@git.branch('master').contains?('git_grep')) + end + def test_branch_commit assert_equal(270, @git.branches[:test_branches].gcommit.size) end From f911c26b388f343f6898428bc66a3489631737a1 Mon Sep 17 00:00:00 2001 From: Matias Garcia Isaia Date: Thu, 12 Jul 2018 16:49:52 -0300 Subject: [PATCH 08/12] commit with custom author date (#374) Signed-off-by: mgarciaisaia --- lib/git/lib.rb | 1 + tests/units/test_lib.rb | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 8f05f9b0..834511f8 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -556,6 +556,7 @@ def commit(message, opts = {}) arr_opts << '--all' if opts[:add_all] || opts[:all] arr_opts << '--allow-empty' if opts[:allow_empty] arr_opts << "--author=#{opts[:author]}" if opts[:author] + arr_opts << "--date=#{opts[:date]}" if opts[:date].is_a? String command('commit', arr_opts) end diff --git a/tests/units/test_lib.rb b/tests/units/test_lib.rb index 403a2877..ff5446f1 100644 --- a/tests/units/test_lib.rb +++ b/tests/units/test_lib.rb @@ -21,7 +21,20 @@ def test_commit_data assert_equal("test\n", data['message']) assert_equal(["546bec6f8872efa41d5d97a369f669165ecda0de"], data['parent']) end - + + def test_commit_with_date + create_file("#{@wdir}/test_file_1", 'content tets_file_1') + @lib.add('test_file_1') + + author_date = Time.new(2016, 8, 3, 17, 37, 0, "-03:00") + + @lib.commit('commit with date', date: author_date.strftime('%Y-%m-%dT%H:%M:%S %z')) + + data = @lib.commit_data('HEAD') + + assert_equal("Scott Chacon #{author_date.strftime("%s %z")}", data['author']) + end + def test_checkout assert(@lib.checkout('test_checkout_b',{:new_branch=>true})) assert(@lib.checkout('master')) From 7ff5d78f15cf245c753e12eedf30ecbc15e18319 Mon Sep 17 00:00:00 2001 From: Kody Date: Sat, 28 Jul 2018 17:33:52 +0100 Subject: [PATCH 09/12] Support 'push --delete' (#325) Signed-off-by: Kody --- lib/git/lib.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 834511f8..71cc7fad 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -755,6 +755,7 @@ def push(remote, branch = 'master', opts = {}) arr_opts = [] arr_opts << '--mirror' if opts[:mirror] + arr_opts << '--delete' if opts[:delete] arr_opts << '--force' if opts[:force] || opts[:f] arr_opts << remote From 93414167d7f1d56c72f9320e2606f4d5d3597c2c Mon Sep 17 00:00:00 2001 From: Vern Burton Date: Wed, 1 Aug 2018 09:16:42 -0500 Subject: [PATCH 10/12] using File as a block so that it tears down once everything has completed, adding a API directly in stashes, and adding testing around it. (#378) Signed-off-by: Vern Burton --- lib/git/lib.rb | 10 ++++++---- lib/git/stashes.rb | 11 +++++++++++ tests/units/test_stashes.rb | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 71cc7fad..fc390af5 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -604,10 +604,12 @@ def stashes_all arr = [] filename = File.join(@git_dir, 'logs/refs/stash') if File.exist?(filename) - File.open(filename).each_with_index { |line, i| - m = line.match(/:(.*)$/) - arr << [i, m[1].strip] - } + File.open(filename) do |f| + f.each_with_index do |line, i| + m = line.match(/:(.*)$/) + arr << [i, m[1].strip] + end + end end arr end diff --git a/lib/git/stashes.rb b/lib/git/stashes.rb index 8bb71af5..0ebb9bed 100644 --- a/lib/git/stashes.rb +++ b/lib/git/stashes.rb @@ -13,6 +13,17 @@ def initialize(base) @stashes.unshift(Git::Stash.new(@base, message, true)) end end + + # + # Returns an multi-dimensional Array of elements that have been stash saved. + # Array is based on position and name. See Example + # + # @example Returns Array of items that have been stashed + # .all - [0, "testing-stash-all"]] + # @return [Array] + def all + @base.lib.stashes_all + end def save(message) s = Git::Stash.new(@base, message) diff --git a/tests/units/test_stashes.rb b/tests/units/test_stashes.rb index 2306061b..c47ab1d9 100644 --- a/tests/units/test_stashes.rb +++ b/tests/units/test_stashes.rb @@ -32,5 +32,27 @@ def test_stash_unstash end end end + + def test_stashes_all + in_temp_dir do |path| + g = Git.clone(@wbare, 'stash_test') + Dir.chdir('stash_test') do + assert_equal(0, g.branch.stashes.size) + new_file('test-file1', 'blahblahblah1') + new_file('test-file2', 'blahblahblah2') + assert(g.status.untracked.assoc('test-file1')) + + g.add + + assert(g.status.added.assoc('test-file1')) + + g.branch.stashes.save('testing-stash-all') + + stashes = g.branch.stashes.all + + assert(stashes[0].include?('testing-stash-all')) + end + end + end end \ No newline at end of file From 6d5bacdbc05a08c93cd72aeb428c8d904b0f260b Mon Sep 17 00:00:00 2001 From: Vern Burton Date: Wed, 1 Aug 2018 11:29:32 -0500 Subject: [PATCH 11/12] removing un-needed file as we are now using Git::VERSION from inside the lib/git (#379) Signed-off-by: Vern Burton --- VERSION | 2 -- git.gemspec | 1 - 2 files changed, 3 deletions(-) delete mode 100644 VERSION diff --git a/VERSION b/VERSION deleted file mode 100644 index 1e754301..00000000 --- a/VERSION +++ /dev/null @@ -1,2 +0,0 @@ -1.3.0 - diff --git a/git.gemspec b/git.gemspec index 75ef5a41..a3c5d5d3 100644 --- a/git.gemspec +++ b/git.gemspec @@ -28,7 +28,6 @@ Gem::Specification.new do |s| 'MAINTAINERS.md', 'LICENSE', 'README.md', - 'VERSION', 'lib/git.rb', 'lib/git/author.rb', 'lib/git/base.rb', From fd2642a626d20594a25010526f10ff99431c2cca Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 10 Aug 2018 09:57:26 +0200 Subject: [PATCH 12/12] Release v1.5.0 --- CHANGELOG.md | 8 ++++++++ lib/git/version.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f780d64..b24e5cfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.5.0 + +See https://github.com/ruby-git/ruby-git/releases/tag/v1.5.0 + +## 1.4.0 + +See https://github.com/ruby-git/ruby-git/releases/tag/v1.4.0 + ## 1.3.0 * Dropping Ruby 1.8.x support diff --git a/lib/git/version.rb b/lib/git/version.rb index 0cc3a1e8..62fd6033 100644 --- a/lib/git/version.rb +++ b/lib/git/version.rb @@ -1,5 +1,5 @@ module Git # The current gem version # @return [String] the current gem version. - VERSION='1.4.0' + VERSION='1.5.0' end