big_stash 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/README.md +15 -5
- data/big_stash.gemspec +1 -1
- data/lib/big_stash.rb +8 -0
- data/lib/big_stash/stash_operator.rb +16 -5
- data/lib/big_stash/version.rb +1 -1
- data/resources/demo.png +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0104ff23a4dd0b70e2e235f2d7599c0b3c8a86fd
|
4
|
+
data.tar.gz: 8533fa7c8015980765f40356fe998a3759ade7d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b903f3a921a767695893f6090574036237bbc3986c9167139b21fabaf979f5e320be3d252cee5ade1080e805d70586be663a4a842f4c7e7239ed9469fff1c49
|
7
|
+
data.tar.gz: a169afac217dd9d001065efd0c3bb57c3ae692b1663a3ec772d014e613ad5859680c61f6aa4538142ea7fe2c43c5399f1d0fe31318fb2107eaeb1a10f10bf69e
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# BigStash
|
2
2
|
|
3
|
+

|
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 `
|
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
|
-
|
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
|
-
|
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
|
-
|
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/
|
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/
|
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
|
20
|
-
|
19
|
+
if @stashes[name]
|
20
|
+
raise "Already have a stash with name #{name}"
|
21
21
|
else
|
22
|
-
|
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
|
-
|
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
|
data/lib/big_stash/version.rb
CHANGED
data/resources/demo.png
ADDED
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.
|
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-
|
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
|
-
|
75
|
+
- resources/demo.png
|
76
|
+
homepage: https://github.com/BigKeeper/big-stash
|
76
77
|
licenses:
|
77
78
|
- MIT
|
78
79
|
metadata:
|