git-smart 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -0
- data/Gemfile.lock +6 -0
- data/README.md +10 -20
- data/Rakefile +7 -0
- data/VERSION +1 -1
- data/docs/images/git-smart.png +0 -0
- data/docs/smart-merge.html +211 -0
- data/docs/smart-pull.html +274 -0
- data/git-smart.gemspec +13 -2
- data/lib/commands/smart-merge.rb +63 -0
- data/lib/commands/smart-pull.rb +38 -10
- data/lib/git-smart/git_repo.rb +27 -10
- data/spec/smart-merge_failures_spec.rb +46 -0
- data/spec/smart-merge_spec.rb +101 -0
- data/spec/smart-pull_spec.rb +2 -5
- data/spec/spec_helper.rb +2 -1
- metadata +52 -23
    
        data/spec/smart-pull_spec.rb
    CHANGED
    
    | @@ -63,8 +63,7 @@ describe 'smart-pull' do | |
| 63 63 | 
             
                  out = run_command(local_dir, 'smart-pull')
         | 
| 64 64 | 
             
                  out.should report("Executing: git fetch origin")
         | 
| 65 65 | 
             
                  out.should report(/master +-> +origin\/master/)
         | 
| 66 | 
            -
                  out.should report("There is 1 new commit on master.")
         | 
| 67 | 
            -
                  out.should report("No uncommitted changes, no need to stash.")
         | 
| 66 | 
            +
                  out.should report("There is 1 new commit on 'origin/master'.")
         | 
| 68 67 | 
             
                  out.should report("Local branch 'master' has not moved on. Fast-forwarding.")
         | 
| 69 68 | 
             
                  out.should report("Executing: git merge --ff-only origin/master")
         | 
| 70 69 | 
             
                  out.should report(/Updating [^\.]+..[^\.]+/)
         | 
| @@ -78,7 +77,6 @@ describe 'smart-pull' do | |
| 78 77 | 
             
                  ]
         | 
| 79 78 | 
             
                  local_dir.should have_git_status({:untracked => ['noob']})
         | 
| 80 79 | 
             
                  out = run_command(local_dir, 'smart-pull')
         | 
| 81 | 
            -
                  out.should report("No uncommitted changes, no need to stash.")
         | 
| 82 80 | 
             
                  out.should report("Executing: git merge --ff-only origin/master")
         | 
| 83 81 | 
             
                  out.should report("1 files changed, 1 insertions(+), 0 deletions(-)")
         | 
| 84 82 | 
             
                  local_dir.should have_git_status({:untracked => ['noob']})
         | 
| @@ -122,7 +120,7 @@ describe 'smart-pull' do | |
| 122 120 | 
             
                  out = run_command(local_dir, 'smart-pull')
         | 
| 123 121 | 
             
                  out.should report("Executing: git fetch origin")
         | 
| 124 122 | 
             
                  out.should report(/master +-> +origin\/master/)
         | 
| 125 | 
            -
                  out.should report("There is 1 new commit on master.")
         | 
| 123 | 
            +
                  out.should report("There is 1 new commit on 'origin/master'.")
         | 
| 126 124 | 
             
                  out.should report("Both local and remote branches have moved on. Branch 'master' needs to be rebased onto 'origin/master'")
         | 
| 127 125 | 
             
                  out.should report("Executing: git rebase -p origin/master")
         | 
| 128 126 | 
             
                  out.should report("Successfully rebased and updated refs/heads/master.")
         | 
| @@ -136,7 +134,6 @@ describe 'smart-pull' do | |
| 136 134 | 
             
                  ]
         | 
| 137 135 | 
             
                  local_dir.should have_git_status({:untracked => ['noob']})
         | 
| 138 136 | 
             
                  out = run_command(local_dir, 'smart-pull')
         | 
| 139 | 
            -
                  out.should report("No uncommitted changes, no need to stash.")
         | 
| 140 137 | 
             
                  out.should report("Executing: git rebase -p origin/master")
         | 
| 141 138 | 
             
                  out.should report("Successfully rebased and updated refs/heads/master.")
         | 
| 142 139 | 
             
                  local_dir.should have_git_status({:untracked => ['noob']})
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -6,6 +6,7 @@ WORKING_DIR = File.dirname(__FILE__) + '/working' | |
| 6 6 |  | 
| 7 7 | 
             
            RSpec.configure do |config|
         | 
| 8 8 | 
             
              config.before :each do
         | 
| 9 | 
            +
                FileUtils.rm_rf WORKING_DIR
         | 
| 9 10 | 
             
                FileUtils.mkdir_p WORKING_DIR
         | 
| 10 11 | 
             
              end
         | 
| 11 12 |  | 
| @@ -14,7 +15,7 @@ RSpec.configure do |config| | |
| 14 15 | 
             
              end
         | 
| 15 16 | 
             
            end
         | 
| 16 17 |  | 
| 17 | 
            -
            def run_command(dir, command, args | 
| 18 | 
            +
            def run_command(dir, command, *args)
         | 
| 18 19 | 
             
              require 'stringio'
         | 
| 19 20 | 
             
              $stdout = stdout = StringIO.new
         | 
| 20 21 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,12 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: git-smart
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            +
              hash: 19
         | 
| 4 5 | 
             
              prerelease: false
         | 
| 5 6 | 
             
              segments: 
         | 
| 6 7 | 
             
              - 0
         | 
| 7 8 | 
             
              - 1
         | 
| 8 | 
            -
              -  | 
| 9 | 
            -
              version: 0.1. | 
| 9 | 
            +
              - 4
         | 
| 10 | 
            +
              version: 0.1.4
         | 
| 10 11 | 
             
            platform: ruby
         | 
| 11 12 | 
             
            authors: 
         | 
| 12 13 | 
             
            - Glen Maddern
         | 
| @@ -14,80 +15,99 @@ autorequire: | |
| 14 15 | 
             
            bindir: bin
         | 
| 15 16 | 
             
            cert_chain: []
         | 
| 16 17 |  | 
| 17 | 
            -
            date: 2011-01- | 
| 18 | 
            +
            date: 2011-01-05 00:00:00 +11:00
         | 
| 18 19 | 
             
            default_executable: git-smart
         | 
| 19 20 | 
             
            dependencies: 
         | 
| 20 21 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 22 | 
            +
              prerelease: false
         | 
| 23 | 
            +
              type: :runtime
         | 
| 21 24 | 
             
              name: colorize
         | 
| 22 | 
            -
               | 
| 25 | 
            +
              version_requirements: &id001 !ruby/object:Gem::Requirement 
         | 
| 23 26 | 
             
                none: false
         | 
| 24 27 | 
             
                requirements: 
         | 
| 25 28 | 
             
                - - ">="
         | 
| 26 29 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 30 | 
            +
                    hash: 3
         | 
| 27 31 | 
             
                    segments: 
         | 
| 28 32 | 
             
                    - 0
         | 
| 29 33 | 
             
                    version: "0"
         | 
| 30 | 
            -
               | 
| 31 | 
            -
              prerelease: false
         | 
| 32 | 
            -
              version_requirements: *id001
         | 
| 34 | 
            +
              requirement: *id001
         | 
| 33 35 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 36 | 
            +
              prerelease: false
         | 
| 37 | 
            +
              type: :development
         | 
| 34 38 | 
             
              name: rspec
         | 
| 35 | 
            -
               | 
| 39 | 
            +
              version_requirements: &id002 !ruby/object:Gem::Requirement 
         | 
| 36 40 | 
             
                none: false
         | 
| 37 41 | 
             
                requirements: 
         | 
| 38 42 | 
             
                - - ~>
         | 
| 39 43 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 44 | 
            +
                    hash: 3
         | 
| 40 45 | 
             
                    segments: 
         | 
| 41 46 | 
             
                    - 2
         | 
| 42 47 | 
             
                    - 3
         | 
| 43 48 | 
             
                    - 0
         | 
| 44 49 | 
             
                    version: 2.3.0
         | 
| 45 | 
            -
               | 
| 46 | 
            -
              prerelease: false
         | 
| 47 | 
            -
              version_requirements: *id002
         | 
| 50 | 
            +
              requirement: *id002
         | 
| 48 51 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 52 | 
            +
              prerelease: false
         | 
| 53 | 
            +
              type: :development
         | 
| 49 54 | 
             
              name: rcov
         | 
| 50 | 
            -
               | 
| 55 | 
            +
              version_requirements: &id003 !ruby/object:Gem::Requirement 
         | 
| 51 56 | 
             
                none: false
         | 
| 52 57 | 
             
                requirements: 
         | 
| 53 58 | 
             
                - - ">="
         | 
| 54 59 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 60 | 
            +
                    hash: 3
         | 
| 55 61 | 
             
                    segments: 
         | 
| 56 62 | 
             
                    - 0
         | 
| 57 63 | 
             
                    version: "0"
         | 
| 58 | 
            -
               | 
| 59 | 
            -
              prerelease: false
         | 
| 60 | 
            -
              version_requirements: *id003
         | 
| 64 | 
            +
              requirement: *id003
         | 
| 61 65 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 66 | 
            +
              prerelease: false
         | 
| 67 | 
            +
              type: :development
         | 
| 62 68 | 
             
              name: bundler
         | 
| 63 | 
            -
               | 
| 69 | 
            +
              version_requirements: &id004 !ruby/object:Gem::Requirement 
         | 
| 64 70 | 
             
                none: false
         | 
| 65 71 | 
             
                requirements: 
         | 
| 66 72 | 
             
                - - ~>
         | 
| 67 73 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 74 | 
            +
                    hash: 23
         | 
| 68 75 | 
             
                    segments: 
         | 
| 69 76 | 
             
                    - 1
         | 
| 70 77 | 
             
                    - 0
         | 
| 71 78 | 
             
                    - 0
         | 
| 72 79 | 
             
                    version: 1.0.0
         | 
| 73 | 
            -
               | 
| 74 | 
            -
              prerelease: false
         | 
| 75 | 
            -
              version_requirements: *id004
         | 
| 80 | 
            +
              requirement: *id004
         | 
| 76 81 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 82 | 
            +
              prerelease: false
         | 
| 83 | 
            +
              type: :development
         | 
| 77 84 | 
             
              name: jeweler
         | 
| 78 | 
            -
               | 
| 85 | 
            +
              version_requirements: &id005 !ruby/object:Gem::Requirement 
         | 
| 79 86 | 
             
                none: false
         | 
| 80 87 | 
             
                requirements: 
         | 
| 81 88 | 
             
                - - ~>
         | 
| 82 89 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 90 | 
            +
                    hash: 7
         | 
| 83 91 | 
             
                    segments: 
         | 
| 84 92 | 
             
                    - 1
         | 
| 85 93 | 
             
                    - 5
         | 
| 86 94 | 
             
                    - 2
         | 
| 87 95 | 
             
                    version: 1.5.2
         | 
| 88 | 
            -
               | 
| 96 | 
            +
              requirement: *id005
         | 
| 97 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 89 98 | 
             
              prerelease: false
         | 
| 90 | 
            -
               | 
| 99 | 
            +
              type: :development
         | 
| 100 | 
            +
              name: rocco
         | 
| 101 | 
            +
              version_requirements: &id006 !ruby/object:Gem::Requirement 
         | 
| 102 | 
            +
                none: false
         | 
| 103 | 
            +
                requirements: 
         | 
| 104 | 
            +
                - - ">="
         | 
| 105 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 106 | 
            +
                    hash: 3
         | 
| 107 | 
            +
                    segments: 
         | 
| 108 | 
            +
                    - 0
         | 
| 109 | 
            +
                    version: "0"
         | 
| 110 | 
            +
              requirement: *id006
         | 
| 91 111 | 
             
            description: Installs some additional 'smart' git commands, like `git smart-pull`.
         | 
| 92 112 | 
             
            email: glenmaddern@gmail.com
         | 
| 93 113 | 
             
            executables: 
         | 
| @@ -105,7 +125,11 @@ files: | |
| 105 125 | 
             
            - Rakefile
         | 
| 106 126 | 
             
            - VERSION
         | 
| 107 127 | 
             
            - bin/git-smart
         | 
| 128 | 
            +
            - docs/images/git-smart.png
         | 
| 129 | 
            +
            - docs/smart-merge.html
         | 
| 130 | 
            +
            - docs/smart-pull.html
         | 
| 108 131 | 
             
            - git-smart.gemspec
         | 
| 132 | 
            +
            - lib/commands/smart-merge.rb
         | 
| 109 133 | 
             
            - lib/commands/smart-pull.rb
         | 
| 110 134 | 
             
            - lib/core_ext/array.rb
         | 
| 111 135 | 
             
            - lib/core_ext/hash.rb
         | 
| @@ -116,6 +140,8 @@ files: | |
| 116 140 | 
             
            - lib/git-smart/git_repo.rb
         | 
| 117 141 | 
             
            - lib/git-smart/git_smart.rb
         | 
| 118 142 | 
             
            - lib/git-smart/safe_shell.rb
         | 
| 143 | 
            +
            - spec/smart-merge_failures_spec.rb
         | 
| 144 | 
            +
            - spec/smart-merge_spec.rb
         | 
| 119 145 | 
             
            - spec/smart-pull_spec.rb
         | 
| 120 146 | 
             
            - spec/spec_helper.rb
         | 
| 121 147 | 
             
            has_rdoc: true
         | 
| @@ -132,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 132 158 | 
             
              requirements: 
         | 
| 133 159 | 
             
              - - ">="
         | 
| 134 160 | 
             
                - !ruby/object:Gem::Version 
         | 
| 135 | 
            -
                  hash:  | 
| 161 | 
            +
                  hash: 3
         | 
| 136 162 | 
             
                  segments: 
         | 
| 137 163 | 
             
                  - 0
         | 
| 138 164 | 
             
                  version: "0"
         | 
| @@ -141,6 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 141 167 | 
             
              requirements: 
         | 
| 142 168 | 
             
              - - ">="
         | 
| 143 169 | 
             
                - !ruby/object:Gem::Version 
         | 
| 170 | 
            +
                  hash: 3
         | 
| 144 171 | 
             
                  segments: 
         | 
| 145 172 | 
             
                  - 0
         | 
| 146 173 | 
             
                  version: "0"
         | 
| @@ -152,5 +179,7 @@ signing_key: | |
| 152 179 | 
             
            specification_version: 3
         | 
| 153 180 | 
             
            summary: Add some smarts to your git workflow
         | 
| 154 181 | 
             
            test_files: 
         | 
| 182 | 
            +
            - spec/smart-merge_failures_spec.rb
         | 
| 183 | 
            +
            - spec/smart-merge_spec.rb
         | 
| 155 184 | 
             
            - spec/smart-pull_spec.rb
         | 
| 156 185 | 
             
            - spec/spec_helper.rb
         |