git_curate 0.7.5 → 0.8.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/CHANGELOG.md +9 -0
- data/README.md +6 -5
- data/VERSION +1 -1
- data/assets/demo.gif +0 -0
- data/git_curate.gemspec +1 -1
- data/lib/git_curate/branch.rb +7 -2
- data/lib/git_curate/runner.rb +29 -19
- data/lib/git_curate/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a28aa1f3d401c90e8955406bd6917d5669af3c21be54e548c23a46370254383d
|
4
|
+
data.tar.gz: c33041318700ca15a1f592e29ecee075f58776ce972b178c13fe90356cdbd560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3539fde73f294610c797ab422b6503d893b74af254a2fc524ee8d338341b953a4775c179875c146ae3942f08dd2c606eae547d328b6aaa3363f5f1122e32ce20
|
7
|
+
data.tar.gz: ecd19b5b368d86911627176f84ad4f06bfffe921813a07bd42554a08bb2411a12d6e93b4fba3a65072208972f7a299d4a34791dfb748f2cfd14ee77eba0c43d4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### v0.8.0
|
4
|
+
|
5
|
+
* Change options to make them more memorable/obvious
|
6
|
+
* Always print options legend at top, if in interactive mode
|
7
|
+
* Add a column showing last commit hash
|
8
|
+
* Tweak column header layout
|
9
|
+
* Fix warnings on Ruby 2.7
|
10
|
+
* Fix minor error in README
|
11
|
+
|
3
12
|
### v0.7.5
|
4
13
|
|
5
14
|
* Drop support for Ruby 2.1
|
data/README.md
CHANGED
@@ -17,6 +17,7 @@ one at a time and _then_ running `git branch -D` in a separate step, is painful.
|
|
17
17
|
a time, outputting the following information about each:
|
18
18
|
|
19
19
|
* Last commit date
|
20
|
+
* Last commit hash
|
20
21
|
* Last commit author
|
21
22
|
* Last commit subject
|
22
23
|
* Whether the branch has been merged into the current HEAD
|
@@ -49,18 +50,18 @@ git curate
|
|
49
50
|
This will step you through your local branches one at a time, outputting some information about
|
50
51
|
each, and asking you whether to keep or delete each branch.
|
51
52
|
|
52
|
-
At each branch, enter "
|
53
|
-
or enter "
|
53
|
+
At each branch, enter "k"—or simply press Enter—to _keep_ the branch and move to the next one;
|
54
|
+
or enter "d" to select the branch for deletion.
|
54
55
|
|
55
|
-
Entering "
|
56
|
-
|
56
|
+
Entering "e" will end the session immediately, deleting all selected branches; and "a" will
|
57
|
+
abort the session without deleting any branches. Once the final branch has been considered,
|
57
58
|
any selected branches will be immediately deleted.
|
58
59
|
|
59
60
|
Note the branch you are currently on will not be included in the list, as `git` does not allow you to delete
|
60
61
|
the branch you're on.
|
61
62
|
|
62
63
|
If you just want to view the information about your local branches without stepping through
|
63
|
-
them interactively, enter `git
|
64
|
+
them interactively, enter `git curate --list` or `git curate -l`. Your current branch _will_
|
64
65
|
be included in this list in this case.
|
65
66
|
|
66
67
|
## Contributing
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.8.0
|
data/assets/demo.gif
CHANGED
Binary file
|
data/git_curate.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
31
|
spec.add_runtime_dependency "highline", "2.0.3"
|
32
|
-
spec.add_runtime_dependency "tabulo", "2.4.
|
32
|
+
spec.add_runtime_dependency "tabulo", "2.4.1"
|
33
33
|
spec.add_runtime_dependency "tty-screen", "0.7.1"
|
34
34
|
|
35
35
|
spec.add_development_dependency "bundler"
|
data/lib/git_curate/branch.rb
CHANGED
@@ -50,6 +50,11 @@ module GitCurate
|
|
50
50
|
@last_commit_date
|
51
51
|
end
|
52
52
|
|
53
|
+
def hash
|
54
|
+
initialize_last_commit_data
|
55
|
+
@hash
|
56
|
+
end
|
57
|
+
|
53
58
|
def last_author
|
54
59
|
initialize_last_commit_data
|
55
60
|
@last_author
|
@@ -109,10 +114,10 @@ module GitCurate
|
|
109
114
|
|
110
115
|
# For Windows compatibility we need double quotes around the format string, as well as spaces
|
111
116
|
# between the placeholders.
|
112
|
-
command = %Q(git log -n1 --date=short --format=format:"%cd %n %an %n %s" #{proper_name} --)
|
117
|
+
command = %Q(git log -n1 --date=short --format=format:"%cd %n %h %n %an %n %s" #{proper_name} --)
|
113
118
|
@last_commit_data = Util.command_to_a(command)
|
114
119
|
|
115
|
-
@last_commit_date, @last_author, @last_subject = @last_commit_data
|
120
|
+
@last_commit_date, @hash, @last_author, @last_subject = @last_commit_data
|
116
121
|
end
|
117
122
|
|
118
123
|
end
|
data/lib/git_curate/runner.rb
CHANGED
@@ -26,21 +26,27 @@ module GitCurate
|
|
26
26
|
return EXIT_FAILURE
|
27
27
|
end
|
28
28
|
|
29
|
+
if interactive?
|
30
|
+
puts
|
31
|
+
print_help
|
32
|
+
puts
|
33
|
+
end
|
34
|
+
|
29
35
|
branches = Branch.local
|
30
36
|
branches.reject!(&:current?) if interactive?
|
31
37
|
|
32
38
|
table = Tabulo::Table.new(branches, border: :reduced_ascii, column_padding: 0, align_header: :left) do |t|
|
33
39
|
t.add_column(:branch, header: "Branch") { |b| b.displayable_name(pad: !interactive?) }
|
34
|
-
t.add_column("Last commit", &:last_commit_date)
|
35
|
-
t.add_column("
|
36
|
-
t.add_column("
|
40
|
+
t.add_column("Last commit:#{$/}Date", &:last_commit_date)
|
41
|
+
t.add_column("#{$/}Hash", &:hash)
|
42
|
+
t.add_column("#{$/}Author", &:last_author)
|
43
|
+
t.add_column("#{$/}Subject", &:last_subject)
|
37
44
|
t.add_column("Merged#{$/}into HEAD?") { |b| b.merged? ? "Merged" : "Not merged" }
|
38
45
|
t.add_column("Status vs#{$/}upstream", &:upstream_info)
|
39
46
|
end
|
40
47
|
|
41
|
-
prompt = "
|
42
|
-
|
43
|
-
prompt_and_response_width = (interactive? ? (prompt.length + longest_response.length + 1) : 0)
|
48
|
+
prompt = " d/[k]/e/a ? "
|
49
|
+
prompt_and_response_width = (interactive? ? (prompt.length + 2) : 0)
|
44
50
|
max_table_width = TTY::Screen.width - prompt_and_response_width
|
45
51
|
table.pack(max_table_width: max_table_width)
|
46
52
|
|
@@ -53,15 +59,15 @@ module GitCurate
|
|
53
59
|
|
54
60
|
table.each_with_index do |row, index|
|
55
61
|
case HighLine.ask("#{row} #{prompt}").downcase
|
56
|
-
when "
|
62
|
+
when "d"
|
57
63
|
branches_to_delete << row.source
|
58
|
-
when "
|
64
|
+
when "k", ""
|
59
65
|
; # do nothing
|
60
|
-
when "
|
66
|
+
when "e"
|
61
67
|
puts table.horizontal_rule
|
62
68
|
finalize(branches_to_delete)
|
63
69
|
return EXIT_SUCCESS
|
64
|
-
when "
|
70
|
+
when "a"
|
65
71
|
puts table.horizontal_rule
|
66
72
|
puts "#{$/}Aborting. No branches deleted."
|
67
73
|
return EXIT_SUCCESS
|
@@ -95,15 +101,19 @@ module GitCurate
|
|
95
101
|
end
|
96
102
|
|
97
103
|
def print_help
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
104
|
+
instructions = [
|
105
|
+
["d :", "delete branch"],
|
106
|
+
["k / <enter> :", "keep branch"],
|
107
|
+
["e :", "end session, deleting all selected branches"],
|
108
|
+
["a :", "abort session, keeping all branches"],
|
109
|
+
]
|
110
|
+
instructions_table = Tabulo::Table.new(instructions, border: :blank, header_frequency: nil,
|
111
|
+
column_padding: [1, 0]) do |t|
|
112
|
+
|
113
|
+
t.add_column(0, align_body: :right, &:first)
|
114
|
+
t.add_column(1, &:last)
|
115
|
+
end
|
116
|
+
puts instructions_table.pack
|
107
117
|
end
|
108
118
|
|
109
119
|
end
|
data/lib/git_curate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_curate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Harvey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.4.
|
33
|
+
version: 2.4.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.4.
|
40
|
+
version: 2.4.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tty-screen
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,8 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
|
-
|
192
|
-
rubygems_version: 2.7.6
|
191
|
+
rubygems_version: 3.1.2
|
193
192
|
signing_key:
|
194
193
|
specification_version: 4
|
195
194
|
summary: Simple git branch curation tool
|