git-branch-delete-orphans 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +19 -0
- data/README.md +42 -0
- data/bin/git-branch-delete-orphans +8 -2
- data/lib/git-branch-delete-orphans/version.rb +1 -1
- metadata +27 -44
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## Version 0.0.3
|
4
|
+
|
5
|
+
* Ruby 1.9 compatibility PR [#2][] by [@waynemoore][]
|
6
|
+
* Let the user know when there is nothing to be done. PR [#2][] by
|
7
|
+
[@waynemoore][]
|
8
|
+
|
9
|
+
## Version 0.0.2
|
10
|
+
|
11
|
+
* Fix binary shabang by [@pcreux][]
|
12
|
+
|
13
|
+
## Version 0.0.1
|
14
|
+
|
15
|
+
* Initial version by [@pcreux][]
|
16
|
+
<!--- The following link definition list is generated by PimpMyChangelog --->
|
17
|
+
[#2]: https://github.com/pcreux/git/issues/2
|
18
|
+
[@pcreux]: https://github.com/pcreux
|
19
|
+
[@waynemoore]: https://github.com/waynemoore
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# git-branch-delete-orphans
|
2
|
+
|
3
|
+
`git-branch-delete-orphans` list all local-tracking branches which
|
4
|
+
remote does not exist anymore and prompts you to delete them.
|
5
|
+
|
6
|
+
## Install
|
7
|
+
|
8
|
+
gem install git-branch-delete-orphans
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
git-branch-delete-orphans
|
13
|
+
|
14
|
+
## Sample output
|
15
|
+
|
16
|
+
<pre>
|
17
|
+
Listing remote branches...
|
18
|
+
From git@git.versapay.com:eft3
|
19
|
+
|
20
|
+
The following branches track a remote branch which does not exist anymore:
|
21
|
+
- inbound_outbound_balances
|
22
|
+
- 6956-refactor-login-for-checkout
|
23
|
+
- 6141-set-timezone-to-PST
|
24
|
+
- 7344-move-non-ar-models-to-services
|
25
|
+
- 2676-refactor-emails
|
26
|
+
- 7461-update-Gemfile
|
27
|
+
|
28
|
+
inbound_outbound_balances tracks a remote branch which does not exist anymore. Do you want to [d]elete it, [D]elete all, [k]eep it or [K]eep all?
|
29
|
+
d
|
30
|
+
Deleted branch inbound_outbound_balances (was 694bb37).
|
31
|
+
|
32
|
+
6956-refactor-login-for-checkout tracks a remote branch which does not exist anymore. Do you want to [d]elete it, [D]elete all, [k]eep it or [K]eep all?
|
33
|
+
</pre>
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
MIT
|
38
|
+
|
39
|
+
## Copyright
|
40
|
+
|
41
|
+
Copyright (c) 2011 VersaPay, Philippe Creux.
|
42
|
+
|
@@ -2,15 +2,21 @@
|
|
2
2
|
|
3
3
|
def remotes
|
4
4
|
puts "Listing remote branches..."
|
5
|
-
@remote ||= `git ls-remote | grep 'refs/heads'`.map { |l| l.gsub(/^.*refs\/heads\//, '').strip }
|
5
|
+
@remote ||= `git ls-remote | grep 'refs/heads'`.split("\n").map { |l| l.gsub(/^.*refs\/heads\//, '').strip }
|
6
6
|
end
|
7
7
|
|
8
8
|
def locals
|
9
|
-
@local ||= `cat .git/config | grep "refs/heads/\\w"`.map { |l| l.gsub(/^.*refs\/heads\//, '').strip }
|
9
|
+
@local ||= `cat .git/config | grep "refs/heads/\\w"`.split("\n").map { |l| l.gsub(/^.*refs\/heads\//, '').strip }
|
10
10
|
end
|
11
11
|
|
12
12
|
def cli(orphans)
|
13
13
|
puts ""
|
14
|
+
|
15
|
+
if orphans.empty?
|
16
|
+
puts "No orphaned local branches, nothing to do."
|
17
|
+
exit
|
18
|
+
end
|
19
|
+
|
14
20
|
puts "The following branches track a remote branch which does not exist anymore:"
|
15
21
|
orphans.each { |b| puts " - #{b}" }
|
16
22
|
|
metadata
CHANGED
@@ -1,74 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-branch-delete-orphans
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Philippe Creux
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2011-10-17 00:00:00 +02:00
|
19
|
-
default_executable: git-branch-delete-orphans
|
12
|
+
date: 2012-06-04 00:00:00.000000000 Z
|
20
13
|
dependencies: []
|
21
|
-
|
22
|
-
|
23
|
-
email:
|
14
|
+
description: ! '`git branch-delete-orphans` lists orphan tracking branches and prompts
|
15
|
+
you to delete or keep them.'
|
16
|
+
email:
|
24
17
|
- pcreux@gmail.com
|
25
|
-
executables:
|
18
|
+
executables:
|
26
19
|
- git-branch-delete-orphans
|
27
20
|
extensions: []
|
28
|
-
|
29
21
|
extra_rdoc_files: []
|
30
|
-
|
31
|
-
files:
|
22
|
+
files:
|
32
23
|
- .gitignore
|
24
|
+
- CHANGELOG.md
|
33
25
|
- Gemfile
|
26
|
+
- README.md
|
34
27
|
- Rakefile
|
35
28
|
- bin/git-branch-delete-orphans
|
36
29
|
- git-branch-delete-orphans.gemspec
|
37
30
|
- lib/git-branch-delete-orphans.rb
|
38
31
|
- lib/git-branch-delete-orphans/version.rb
|
39
|
-
|
40
|
-
homepage: ""
|
32
|
+
homepage: ''
|
41
33
|
licenses: []
|
42
|
-
|
43
34
|
post_install_message:
|
44
35
|
rdoc_options: []
|
45
|
-
|
46
|
-
require_paths:
|
36
|
+
require_paths:
|
47
37
|
- lib
|
48
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
55
|
-
- 0
|
56
|
-
version: "0"
|
57
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
45
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
segments:
|
64
|
-
- 0
|
65
|
-
version: "0"
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
66
50
|
requirements: []
|
67
|
-
|
68
51
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.
|
52
|
+
rubygems_version: 1.8.11
|
70
53
|
signing_key:
|
71
54
|
specification_version: 3
|
72
55
|
summary: Delete tracking branches which remote branch does not exist anymore.
|
73
56
|
test_files: []
|
74
|
-
|
57
|
+
has_rdoc:
|