big_stash 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47a1bae3f3f0a915402741535734b173058aa631
4
- data.tar.gz: e3e88fcbe58c6716bfda43aab3142cdc23217aba
3
+ metadata.gz: 0104ff23a4dd0b70e2e235f2d7599c0b3c8a86fd
4
+ data.tar.gz: 8533fa7c8015980765f40356fe998a3759ade7d9
5
5
  SHA512:
6
- metadata.gz: a93bd133394c82a04cc99485cd9d09bdd41d4b91be3d94a5e44ff67abe6c72de363e9e7becfc1a1ef4518915175b97e25b4d744d40df1634783158c0e3615edf
7
- data.tar.gz: 6d250bfc65bad21fb8ee20be690fae4a8a0dd5c569d7f52109b0a21378631f2cf379eaa7a4eab2c2d2eb879ecf1d031414e0ca3ae832ad9b4a409dc232d223f2
6
+ metadata.gz: 1b903f3a921a767695893f6090574036237bbc3986c9167139b21fabaf979f5e320be3d252cee5ade1080e805d70586be663a4a842f4c7e7239ed9469fff1c49
7
+ data.tar.gz: a169afac217dd9d001065efd0c3bb57c3ae692b1663a3ec772d014e613ad5859680c61f6aa4538142ea7fe2c43c5399f1d0fe31318fb2107eaeb1a10f10bf69e
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # BigStash
2
2
 
3
+ ![](https://github.com/BigKeeper/big-stash/blob/master/resources/demo.png)
4
+
3
5
  big-stash is an enhancement for `git stash` command, you can use it to add and apply a stash with the name you have specified before.
4
6
 
5
7
  ## Installation
@@ -20,14 +22,22 @@ Or install it yourself as:
20
22
 
21
23
  ## Usage
22
24
 
23
- Run `bin/big-stash` to learn how to use big-stash.
25
+ Run `big-stash` to learn how to use big-stash.
24
26
 
25
27
  ### Add a stash with name
26
28
 
27
29
  If you want to add a stash for a git repository, run following command:
28
30
 
29
31
  ``` ruby
30
- bin/big-stash -p [root path for a git repository] add [name of the stash]
32
+ big-stash -p [root path for a git repository] add [name of the stash]
33
+ ```
34
+
35
+ ### Pop a stash with name
36
+
37
+ If you want to apply then delete a stash for a git repository, run following command:
38
+
39
+ ``` ruby
40
+ big-stash -p [root path for a git repository] pop [name of the stash]
31
41
  ```
32
42
 
33
43
  ### Apply a stash with name
@@ -35,7 +45,7 @@ bin/big-stash -p [root path for a git repository] add [name of the stash]
35
45
  If you want to apply a stash for a git repository, run following command:
36
46
 
37
47
  ``` ruby
38
- bin/big-stash -p [root path for a git repository] apply [name of the stash]
48
+ big-stash -p [root path for a git repository] apply [name of the stash]
39
49
  ```
40
50
 
41
51
  ### List all the stashes
@@ -43,7 +53,7 @@ bin/big-stash -p [root path for a git repository] apply [name of the stash]
43
53
  If you want to list all the stashes for a git repository, run following command:
44
54
 
45
55
  ``` ruby
46
- bin/big-stash -p [root path for a git repository] list
56
+ big-stash -p [root path for a git repository] list
47
57
  ```
48
58
 
49
59
  ## Development
@@ -54,7 +64,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
54
64
 
55
65
  ## Contributing
56
66
 
57
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/big_stash.
67
+ Bug reports and pull requests are welcome on GitHub at https://github.com/BigKeeper/big-stash.
58
68
 
59
69
  ## License
60
70
 
data/big_stash.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{Enhancement for git stash.}
13
13
  spec.description = %q{Enhancement for git stash that you can give a name to the stash.}
14
- spec.homepage = "https://github.com/mmoaay/big-stash"
14
+ spec.homepage = "https://github.com/BigKeeper/big-stash"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
data/lib/big_stash.rb CHANGED
@@ -35,6 +35,14 @@ module BigStash
35
35
  end
36
36
  end
37
37
 
38
+ desc 'Pop a stash with name'
39
+ command :pop do |c|
40
+ c.action do |global_options, options, args|
41
+ help_now!('stash name is required') if args.empty?
42
+ BigStash::StashOperator.new(path).pop_stash(args.first)
43
+ end
44
+ end
45
+
38
46
  desc 'List all the stashes'
39
47
  command :list do |c|
40
48
  c.action do
@@ -16,10 +16,14 @@ module BigStash
16
16
  end
17
17
 
18
18
  def stash(name)
19
- if can_stash
20
- p `cd #{@path}; git stash save -a #{name}`
19
+ if @stashes[name]
20
+ raise "Already have a stash with name #{name}"
21
21
  else
22
- p 'Nothing to stash, working tree clean, continue...'
22
+ if can_stash
23
+ p `cd #{@path}; git stash save -a #{name}`
24
+ else
25
+ p 'Nothing to stash, working tree clean, continue...'
26
+ end
23
27
  end
24
28
  end
25
29
 
@@ -35,14 +39,21 @@ module BigStash
35
39
  end
36
40
 
37
41
  def apply_stash(name)
38
- stash = @stashes[name]
39
- if stash
42
+ if @stashes[name]
40
43
  p `cd #{@path}; git stash apply #{stash}`
41
44
  else
42
45
  p %(Nothing to apply, can not find the stash with name '#{name}', continue...)
43
46
  end
44
47
  end
45
48
 
49
+ def pop_stash(name)
50
+ if @stashes[name]
51
+ p `cd #{@path}; git stash pop #{stash}`
52
+ else
53
+ p %(Nothing to pop, can not find the stash with name '#{name}', continue...)
54
+ end
55
+ end
56
+
46
57
  def stash_for_name(name)
47
58
  @stashes[name]
48
59
  end
@@ -1,3 +1,3 @@
1
1
  module BigStash
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: big_stash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-28 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,7 +72,8 @@ files:
72
72
  - lib/big_stash.rb
73
73
  - lib/big_stash/stash_operator.rb
74
74
  - lib/big_stash/version.rb
75
- homepage: https://github.com/mmoaay/big-stash
75
+ - resources/demo.png
76
+ homepage: https://github.com/BigKeeper/big-stash
76
77
  licenses:
77
78
  - MIT
78
79
  metadata: