git_topic 0.1.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 +7 -0
- data/.gitignore +13 -0
- data/.overcommit.yml +30 -0
- data/.rspec +2 -0
- data/.rubocop.yml +8 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/rspec +17 -0
- data/bin/rubocop +17 -0
- data/bin/setup +8 -0
- data/exe/git-topic +5 -0
- data/git_topic.gemspec +35 -0
- data/lib/git_topic/cli.rb +49 -0
- data/lib/git_topic/commands/edit.rb +15 -0
- data/lib/git_topic/commands/list.rb +62 -0
- data/lib/git_topic/commands/show.rb +21 -0
- data/lib/git_topic/version.rb +3 -0
- data/lib/git_topic.rb +6 -0
- metadata +182 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 3976cf9eb95427cfeb1de1250c4bc6f9a4dc5c02
|
|
4
|
+
data.tar.gz: cf643d76a74dff7d435e8cab834f71f049d6eed4
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fc63ccd35623fc0272c4686e926e0d2f835ae11bcd8caa26f793f59ec391f0bec8793b7d7e48e7c48c29e53378a5206f9b9a80a4436dfd61c2aab32d47deb0a2
|
|
7
|
+
data.tar.gz: 543aa2d0e736ee57f97cffcf35e17e9b5dbf8be5e5294817647fe98d0eb3727d6357109fb2d794feb170b1e754bd53d519f99cd32613f68dd6c79ddde43fd95b
|
data/.gitignore
ADDED
data/.overcommit.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Use this file to configure the Overcommit hooks you wish to use. This will
|
|
2
|
+
# extend the default configuration defined in:
|
|
3
|
+
# https://github.com/brigade/overcommit/blob/master/config/default.yml
|
|
4
|
+
#
|
|
5
|
+
# At the topmost level of this YAML file is a key representing type of hook
|
|
6
|
+
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
|
|
7
|
+
# customize each hook, such as whether to only run it on certain files (via
|
|
8
|
+
# `include`), whether to only display output if it fails (via `quiet`), etc.
|
|
9
|
+
#
|
|
10
|
+
# For a complete list of hooks, see:
|
|
11
|
+
# https://github.com/brigade/overcommit/tree/master/lib/overcommit/hook
|
|
12
|
+
#
|
|
13
|
+
# For a complete list of options that you can use to customize hooks, see:
|
|
14
|
+
# https://github.com/brigade/overcommit#configuration
|
|
15
|
+
#
|
|
16
|
+
# Uncomment the following lines to make the configuration take effect.
|
|
17
|
+
|
|
18
|
+
PreCommit:
|
|
19
|
+
RuboCop:
|
|
20
|
+
command: ['bin/rubocop']
|
|
21
|
+
enabled: true
|
|
22
|
+
on_warn: fail # Treat all warnings as failures
|
|
23
|
+
|
|
24
|
+
CommitMsg:
|
|
25
|
+
CapitalizedSubject:
|
|
26
|
+
enabled: false # Use emoji prefix
|
|
27
|
+
|
|
28
|
+
PrePush:
|
|
29
|
+
RSpec:
|
|
30
|
+
enabled: true
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at kompiro@gmail.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Hiroki Kondo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Hiroki Kondo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GitTopic
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
`git topic` is a subcommand of git to manage your topic branches by branch description.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Install it yourself as:
|
|
10
|
+
|
|
11
|
+
$ gem install git-topic
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Commands:
|
|
16
|
+
git-topic edit [branch_name] # Edit topic description
|
|
17
|
+
git-topic show [branch_name] # Show topic description
|
|
18
|
+
git-topic list # Show managed topics
|
|
19
|
+
|
|
20
|
+
Plan to support:
|
|
21
|
+
git-topic add topic_name # Remember topic
|
|
22
|
+
git-topic start topic_name # Transfer topic_name to branch to implement code
|
|
23
|
+
git-topic publish [branch_name] # Create pull request using branch description
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
28
|
+
|
|
29
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
30
|
+
|
|
31
|
+
## Contributing
|
|
32
|
+
|
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kompiro/git-topic. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
38
|
+
|
|
39
|
+
## Code of Conduct
|
|
40
|
+
|
|
41
|
+
Everyone interacting in the Git::Topics project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kompiro/git-topic/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "git_topic"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
require "pry"
|
|
11
|
+
Pry.start
|
|
12
|
+
|
|
13
|
+
#require "irb"
|
|
14
|
+
#IRB.start(__FILE__)
|
data/bin/rspec
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
#
|
|
4
|
+
# This file was generated by Bundler.
|
|
5
|
+
#
|
|
6
|
+
# The application 'rspec' is installed as part of a gem, and
|
|
7
|
+
# this file is here to facilitate running it.
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
require "pathname"
|
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
12
|
+
Pathname.new(__FILE__).realpath)
|
|
13
|
+
|
|
14
|
+
require "rubygems"
|
|
15
|
+
require "bundler/setup"
|
|
16
|
+
|
|
17
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
#
|
|
4
|
+
# This file was generated by Bundler.
|
|
5
|
+
#
|
|
6
|
+
# The application 'rubocop' is installed as part of a gem, and
|
|
7
|
+
# this file is here to facilitate running it.
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
require "pathname"
|
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
12
|
+
Pathname.new(__FILE__).realpath)
|
|
13
|
+
|
|
14
|
+
require "rubygems"
|
|
15
|
+
require "bundler/setup"
|
|
16
|
+
|
|
17
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/bin/setup
ADDED
data/exe/git-topic
ADDED
data/git_topic.gemspec
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require 'git_topic/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = 'git_topic'
|
|
7
|
+
spec.version = GitTopic::VERSION
|
|
8
|
+
spec.authors = ['Hiroki Kondo']
|
|
9
|
+
spec.email = ['kompiro@gmail.com']
|
|
10
|
+
|
|
11
|
+
spec.summary = 'Manage your topic branches'
|
|
12
|
+
spec.description = <<'DESC'
|
|
13
|
+
git-topic enables you to manage your topic branches by simple sub commands like "git topic (add/list/delete)".
|
|
14
|
+
This sub commands use branch description.
|
|
15
|
+
DESC
|
|
16
|
+
spec.homepage = 'https://github.com/kompiro/git-topic'
|
|
17
|
+
spec.license = 'MIT'
|
|
18
|
+
|
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
20
|
+
f.match(%r{^(test|spec|features)/})
|
|
21
|
+
end
|
|
22
|
+
spec.bindir = 'exe'
|
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
24
|
+
spec.require_paths = ['lib']
|
|
25
|
+
|
|
26
|
+
spec.add_runtime_dependency 'thor', '~> 0.20.0'
|
|
27
|
+
spec.add_runtime_dependency 'term-ansicolor', '~> 1.6.0'
|
|
28
|
+
|
|
29
|
+
spec.add_development_dependency 'bundler', '~> 1.15'
|
|
30
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
32
|
+
spec.add_development_dependency 'pry', '~> 0.10.4'
|
|
33
|
+
spec.add_development_dependency 'rubocop', '~> 0.50.0'
|
|
34
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.17.1'
|
|
35
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'thor'
|
|
2
|
+
require 'open3'
|
|
3
|
+
|
|
4
|
+
require 'git_topic/commands/list'
|
|
5
|
+
require 'git_topic/commands/edit'
|
|
6
|
+
require 'git_topic/commands/show'
|
|
7
|
+
|
|
8
|
+
module GitTopic
|
|
9
|
+
# CLI command entry point
|
|
10
|
+
class Cli < Thor
|
|
11
|
+
default_command :list
|
|
12
|
+
|
|
13
|
+
desc 'list', 'Show managed topics'
|
|
14
|
+
def list
|
|
15
|
+
command = GitTopic::Commands::List.new
|
|
16
|
+
command.execute
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
desc 'edit [branch_name]', 'Edit topic description'
|
|
20
|
+
def edit(branch_name = nil)
|
|
21
|
+
command = GitTopic::Commands::Edit.new branch_name
|
|
22
|
+
command.execute
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
desc 'show [branch_name]', 'Show topic description'
|
|
26
|
+
def show(branch_name = nil)
|
|
27
|
+
command = GitTopic::Commands::Show.new branch_name
|
|
28
|
+
command.execute
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
desc 'add topic_name', 'Remember topic'
|
|
32
|
+
def add(topic_name)
|
|
33
|
+
puts "add #{topic_name}"
|
|
34
|
+
raise 'not implemented'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
desc 'start topic_name', 'Transfer topic_name to branch to implement code'
|
|
38
|
+
def start(topic_name)
|
|
39
|
+
puts "start #{topic_name}"
|
|
40
|
+
raise 'not implemented'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
desc 'publish [branch_name]', 'Create pull request using branch description'
|
|
44
|
+
def publish(branch_name)
|
|
45
|
+
puts "publish #{branch_name}"
|
|
46
|
+
raise 'not implemented'
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
module GitTopic
|
|
3
|
+
module Commands
|
|
4
|
+
# edit command edits branch description
|
|
5
|
+
class Edit
|
|
6
|
+
def initialize(topic_name)
|
|
7
|
+
@topic_name = topic_name
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def execute
|
|
11
|
+
system("git branch --edit-description #{@topic_name}")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require 'term/ansicolor'
|
|
2
|
+
|
|
3
|
+
module GitTopic
|
|
4
|
+
module Commands
|
|
5
|
+
# list command shows summarized topic information
|
|
6
|
+
class List
|
|
7
|
+
include Term::ANSIColor
|
|
8
|
+
def execute
|
|
9
|
+
print_header
|
|
10
|
+
print_contents
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def print_header
|
|
16
|
+
printf " %-20s %s\n", 'Branch', 'Summary'
|
|
17
|
+
puts '-' * 80
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def print_contents
|
|
21
|
+
branches, current_branch = parse_branch
|
|
22
|
+
branches.each do |branch_name|
|
|
23
|
+
begin
|
|
24
|
+
print_line(current_branch, branch_name)
|
|
25
|
+
rescue EOFError => _ex
|
|
26
|
+
nop
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def parse_branch
|
|
32
|
+
branches = []
|
|
33
|
+
current_branch = nil
|
|
34
|
+
_stdin, stdout, _stderr, _wait_thr = *Open3.popen3('git branch')
|
|
35
|
+
stdout.each do |line|
|
|
36
|
+
matched = line.match(/\s*(\* )?(.*)/)
|
|
37
|
+
next unless matched
|
|
38
|
+
branches << branch_name = matched[2]
|
|
39
|
+
current_branch = branch_name if matched[1]
|
|
40
|
+
end
|
|
41
|
+
[branches, current_branch]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def print_line(current_branch, branch_name)
|
|
45
|
+
description = get_description_of branch_name
|
|
46
|
+
branch_format = if branch_name == current_branch
|
|
47
|
+
"* #{green}#{bold}%-20s#{clear}"
|
|
48
|
+
else
|
|
49
|
+
" #{bold}%-20s#{clear}"
|
|
50
|
+
end
|
|
51
|
+
printf "#{branch_format} %s", branch_name, description
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def get_description_of(branch)
|
|
55
|
+
config_key = "branch.#{branch}.description"
|
|
56
|
+
command = "git config #{config_key}"
|
|
57
|
+
_stdin, stdout, _stderr, _wait_thr = *Open3.popen3(command)
|
|
58
|
+
stdout.readline
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
module GitTopic
|
|
3
|
+
module Commands
|
|
4
|
+
# show command shows branch description
|
|
5
|
+
class Show
|
|
6
|
+
def initialize(topic_name)
|
|
7
|
+
if topic_name.nil?
|
|
8
|
+
command = 'git rev-parse --abbrev-ref HEAD'
|
|
9
|
+
_stdin, stdout, _stderr, _wait_thr = *Open3.popen3(command)
|
|
10
|
+
topic_name = stdout.readline.chop
|
|
11
|
+
end
|
|
12
|
+
@topic_name = topic_name
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def execute
|
|
16
|
+
config_key = "branch.#{@topic_name}.description"
|
|
17
|
+
system("git config #{config_key}")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/git_topic.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: git_topic
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Hiroki Kondo
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-09-24 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: thor
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.20.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.20.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: term-ansicolor
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 1.6.0
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 1.6.0
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: bundler
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.15'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.15'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rake
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '10.0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '10.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rspec
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3.0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '3.0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: pry
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: 0.10.4
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: 0.10.4
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rubocop
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 0.50.0
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 0.50.0
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: rubocop-rspec
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: 1.17.1
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: 1.17.1
|
|
125
|
+
description: |2
|
|
126
|
+
git-topic enables you to manage your topic branches by simple sub commands like "git topic (add/list/delete)".
|
|
127
|
+
This sub commands use branch description.
|
|
128
|
+
email:
|
|
129
|
+
- kompiro@gmail.com
|
|
130
|
+
executables:
|
|
131
|
+
- git-topic
|
|
132
|
+
extensions: []
|
|
133
|
+
extra_rdoc_files: []
|
|
134
|
+
files:
|
|
135
|
+
- ".gitignore"
|
|
136
|
+
- ".overcommit.yml"
|
|
137
|
+
- ".rspec"
|
|
138
|
+
- ".rubocop.yml"
|
|
139
|
+
- ".travis.yml"
|
|
140
|
+
- CODE_OF_CONDUCT.md
|
|
141
|
+
- Gemfile
|
|
142
|
+
- LICENSE
|
|
143
|
+
- LICENSE.txt
|
|
144
|
+
- README.md
|
|
145
|
+
- Rakefile
|
|
146
|
+
- bin/console
|
|
147
|
+
- bin/rspec
|
|
148
|
+
- bin/rubocop
|
|
149
|
+
- bin/setup
|
|
150
|
+
- exe/git-topic
|
|
151
|
+
- git_topic.gemspec
|
|
152
|
+
- lib/git_topic.rb
|
|
153
|
+
- lib/git_topic/cli.rb
|
|
154
|
+
- lib/git_topic/commands/edit.rb
|
|
155
|
+
- lib/git_topic/commands/list.rb
|
|
156
|
+
- lib/git_topic/commands/show.rb
|
|
157
|
+
- lib/git_topic/version.rb
|
|
158
|
+
homepage: https://github.com/kompiro/git-topic
|
|
159
|
+
licenses:
|
|
160
|
+
- MIT
|
|
161
|
+
metadata: {}
|
|
162
|
+
post_install_message:
|
|
163
|
+
rdoc_options: []
|
|
164
|
+
require_paths:
|
|
165
|
+
- lib
|
|
166
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
|
+
requirements:
|
|
168
|
+
- - ">="
|
|
169
|
+
- !ruby/object:Gem::Version
|
|
170
|
+
version: '0'
|
|
171
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
|
+
requirements:
|
|
173
|
+
- - ">="
|
|
174
|
+
- !ruby/object:Gem::Version
|
|
175
|
+
version: '0'
|
|
176
|
+
requirements: []
|
|
177
|
+
rubyforge_project:
|
|
178
|
+
rubygems_version: 2.6.11
|
|
179
|
+
signing_key:
|
|
180
|
+
specification_version: 4
|
|
181
|
+
summary: Manage your topic branches
|
|
182
|
+
test_files: []
|