git_pivotal_tracker_x 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use --create ruby-1.9.2-p290@git_pivotal_tracker
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Add dependencies required to use your gem here.
4
+ # Example:
5
+ # gem "activesupport", ">= 2.3.5"
6
+ gem "grit"
7
+ gem "pivotal-tracker"
8
+
9
+ # Add dependencies to develop your gem here.
10
+ # Include everything needed to run rake, tests, features, etc.
11
+ group :development do
12
+ gem "bundler", "~> 1.0.0"
13
+ gem "jeweler", "~> 1.6.4"
14
+ gem "rcov", ">= 0"
15
+ gem "rspec", ">= 0"
16
+ gem "cucumber", ">= 0"
17
+ gem "webmock", ">= 0"
18
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2011 Ben Lindsey
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.
@@ -0,0 +1,123 @@
1
+ git\_pivotal\_tracker_x
2
+ ===========
3
+
4
+ Forked from the awesome Git Pivotal Tracker gem by Ben Lindsey and Carbon Five. (You can find the original [here](https://github.com/blindsey/git_pivotal_tracker))
5
+
6
+ Changes included in this version:
7
+
8
+ * Option to automatically delete story branches once they've been merged
9
+ * Ability to pick your integration branch on the fly (when you start a new story)
10
+ * Changed git hook from prepare-commit-msg to commit-msg since commit-msg is better supported by git apps
11
+ * I recommend [Brotherbard's GitX](https://github.com/downloads/phuibonhoa/git_pivotal_tracker/GitX.app.zip) (This is a slightly older version, because the newest one has performance issues for me).
12
+
13
+ Features
14
+ --------
15
+
16
+ * `git-story`
17
+ * `git-feature`
18
+ * `git-bug`
19
+ * `git-chore`
20
+
21
+ These commands start the first available story from your Pivotal Tracker project and create a topic branch for it.
22
+
23
+ * `git-finish`
24
+
25
+ When on a topic branch, this command will:
26
+
27
+ * Fetch the latest integration branch ('master' by default),
28
+ * Rebase your topic branch from it
29
+ * Merge the topic branch into the integration branch with no-fast-forward
30
+ * Push the integration branch to origin
31
+ * (Optionally) delete the topic branch
32
+
33
+ You can customize your integration branch in 2 ways. You can set the integration branch in your git config (see config options below). Additionally, when you create a topic branch, it prompts you for a branch suffix name; if the suffix name you supply is the name of an existing local branch, that branch will be used as your integration branch for that story only. This method will override the integration branch specified in your git config when applicable.
34
+
35
+ * `git-info`
36
+
37
+ Print out the Pivotal Tracker story information for the current topic branch
38
+
39
+ Examples
40
+ --------
41
+
42
+ * FIXME (code sample of usage)
43
+
44
+ Requirements
45
+ ------------
46
+
47
+ * a github account
48
+ * a Pivotal Tracker project
49
+ * Pivotal Tracker api service hook turned on for your github project (under Admin -> Service Hooks)
50
+
51
+ Install
52
+ -------
53
+
54
+ ``gem install git_pivotal_tracker_x``
55
+
56
+ Once installed, git pivotal needs two bits of info: your Pivotal Tracker API Token and your Pivotal Tracker project id:
57
+
58
+ ``git config --global pivotal.api-token 123a456b``
59
+
60
+ The project id is best placed within your project's git config:
61
+
62
+ ``git config -f .git/config pivotal.project-id 88888``
63
+
64
+ If your project's access is setup to use HTTPS:
65
+
66
+ ``git config -f .git/config pivotal.use-ssl 1``
67
+
68
+ If you prefer to merge back to a branch other than master when you've finished a story, you can configure that:
69
+
70
+ ``git config -f .git/config pivotal.integration-branch develop``
71
+
72
+ If you prefer to fetch and rebase from origin before merging (default is no):
73
+
74
+ ``git config --global pivotal.rebase 1``
75
+
76
+ If you prefer to fast-forward your merges into the integration branch (default is --no-ff):
77
+
78
+ ``git config --global pivotal.fast-forward 1``
79
+
80
+ If your Pivotal Tracker user name is different than your git user name:
81
+
82
+ ``git config --global pivotal.full-name 'Ben Lindsey'``
83
+
84
+ If you prefer to have story branches deleted after they are merged by `git-finish`:
85
+
86
+ ``git config --global pivotal.delete-branch 1``
87
+
88
+ If you would like verbose logging turned on for git commands:
89
+
90
+ ``git config --global pivotal.verbose 1``
91
+
92
+
93
+ Contributors
94
+ ------
95
+ * [Philippe Huibonhoa](https://github.com/phuibonhoa/)
96
+ * [Ben Lindsey](https://github.com/blindsey)
97
+ * [Liron Yahdav](https://github.com/lyahdav)
98
+
99
+ License
100
+ -------
101
+
102
+ (The MIT License)
103
+
104
+ Copyright (c) 2011 Ben Lindsey
105
+
106
+ Permission is hereby granted, free of charge, to any person obtaining
107
+ a copy of this software and associated documentation files (the
108
+ 'Software'), to deal in the Software without restriction, including
109
+ without limitation the rights to use, copy, modify, merge, publish,
110
+ distribute, sublicense, and/or sell copies of the Software, and to
111
+ permit persons to whom the Software is furnished to do so, subject to
112
+ the following conditions:
113
+
114
+ The above copyright notice and this permission notice shall be
115
+ included in all copies or substantial portions of the Software.
116
+
117
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
118
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
119
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
120
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
121
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
122
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
123
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "git_pivotal_tracker_x"
18
+ gem.homepage = "http://github.com/phuibonhoa/git_pivotal_tracker"
19
+ gem.license = "MIT"
20
+ gem.summary = "A git workflow integrated with Pivotal Tracker"
21
+ gem.description = "Provides a set of git workflow tools to start and finish Pivotal Tracker stories in topic branches"
22
+ gem.email = "phuibonhoa@gmail.com"
23
+ gem.authors = ["Philippe Huibonhoa"]
24
+ end
25
+ Jeweler::RubygemsDotOrgTasks.new
26
+
27
+
28
+ require 'rspec/core/rake_task'
29
+ RSpec::Core::RakeTask.new(:spec)
30
+
31
+ require 'cucumber/rake/task'
32
+ Cucumber::Rake::Task.new(:cucumber) do |t|
33
+ t.cucumber_opts = '--format progress'
34
+ end
35
+
36
+ require 'rcov/rcovtask'
37
+ Rcov::RcovTask.new do |test|
38
+ test.libs << 'test'
39
+ test.pattern = 'test/**/test_*.rb'
40
+ test.verbose = true
41
+ test.rcov_opts << '--exclude "gems/*"'
42
+ end
43
+
44
+ task :default => [:cucumber, :spec]
45
+
46
+ require 'rdoc/task'
47
+ Rake::RDocTask.new do |rdoc|
48
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
+
50
+ rdoc.rdoc_dir = 'rdoc'
51
+ rdoc.title = "git_pivotal_tracker_x #{version}"
52
+ rdoc.rdoc_files.include('README*')
53
+ rdoc.rdoc_files.include('lib/**/*.rb')
54
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # vim: set syntax=ruby
3
+
4
+ branch = `git branch 2> /dev/null | grep -e ^* | awk '{print $2}'`
5
+ if branch =~ /-(\d{7,})-/
6
+ commit_msg = IO.read(ARGV[0])
7
+ unless commit_msg.include?($1)
8
+ File.open(ARGV[0], 'w') do |file|
9
+ file.print commit_msg
10
+ file.print " [##{$1}]"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'git_pivotal_tracker'
6
+
7
+ exit GitPivotalTracker::Bug.new(*ARGV).run!
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'git_pivotal_tracker'
6
+
7
+ exit GitPivotalTracker::Chore.new(*ARGV).run!
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'git_pivotal_tracker'
6
+
7
+ exit GitPivotalTracker::Feature.new(*ARGV).run!
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'git_pivotal_tracker'
6
+
7
+ exit GitPivotalTracker::Finish.new(*ARGV).run!
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'git_pivotal_tracker'
6
+
7
+ exit GitPivotalTracker::Info.new(*ARGV).run!
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'git_pivotal_tracker'
6
+
7
+ exit GitPivotalTracker::Story.new(*ARGV).run!
@@ -0,0 +1,8 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
5
+ %>
6
+ default: <%= std_opts %> features
7
+ wip: --tags @wip:3 --wip features
8
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,15 @@
1
+ Feature: Diagnostics
2
+ In order to determine what Pivotal Tracker story I'm working on
3
+ As a developer
4
+ I want to be able to view the Pivotal Tracker story associated with my current topic branch
5
+
6
+ Background: A git repo for a project in Pivotal Tracker
7
+ Given the following git repo:
8
+ | Name | Pivotal Tracker Api Token/Project Id |
9
+ | git_pivotal_tracker | aa0469780e3d7322b17ab19de416c874/217457 |
10
+
11
+ Scenario: View the Pivotal Tracker Story for the Current Topic Branch
12
+ When I run `git-story` interactively
13
+ And I type ""
14
+ And I run `git-info`
15
+ Then the output should contain "feature-17553875-sample_feature"
@@ -0,0 +1,35 @@
1
+ Feature: Getting Started
2
+ In order to begin work on an unstarted Pivotal Tracker story
3
+ As a developer
4
+ I want to be able to start a new git branch for the latest unstarted Pivotal Tracker story from the command line
5
+
6
+ Background: A git repo for a project in Pivotal Tracker
7
+ Given the following git repo:
8
+ | Name | Pivotal Tracker Api Token/Project Id |
9
+ | git_pivotal_tracker | aa0469780e3d7322b17ab19de416c874/217457 |
10
+
11
+ Scenario Outline: Begin Working on a Latest Unstarted Story
12
+ When I run `<command>` interactively
13
+ And I type ""
14
+ And I run `git branch`
15
+ Then the output should contain "<git-branch-name>"
16
+
17
+ Examples:
18
+ | command | git-branch-name |
19
+ | git-story | feature-17553875-sample_feature |
20
+ | git-feature | feature-17553875-sample_feature |
21
+ | git-chore | chore-17553885-sample_chore |
22
+ | git-bug | bug-17553879-sample_bug |
23
+
24
+ Scenario Outline: Begin Working on the Latest Unstarted Story in a Custom Branch
25
+ When I run `<command>` interactively
26
+ And I type "<custom-git-branch-name>"
27
+ And I run `git branch`
28
+ Then the output should contain "<custom-git-branch-name>"
29
+
30
+ Examples:
31
+ | command | custom-git-branch-name |
32
+ | git-story | feature-17553875-custom_branch_name |
33
+ | git-feature | feature-17553875-custom_branch_name |
34
+ | git-chore | chore-17553885-custom_branch_name |
35
+ | git-bug | bug-17553879-custom_branch_name |
@@ -0,0 +1,3 @@
1
+ Before do
2
+ @aruba_timeout_seconds = 10
3
+ end
@@ -0,0 +1,14 @@
1
+ Given /^the following git repo:$/ do |table|
2
+ hash = table.hashes.first
3
+ api_token, project_id = hash['Pivotal Tracker Api Token/Project Id'].split '/'
4
+ steps %Q{
5
+ Given a directory named "#{hash[:Name]}"
6
+ And I cd to "#{hash[:Name]}"
7
+ And I run `git init`
8
+ And I run `git config --local pivotal.api-token #{api_token}`
9
+ And I run `git config --local pivotal.project-id #{project_id}`
10
+ And an empty file named "README"
11
+ And I run `git add .`
12
+ And I run `git commit -m "Initial Commit"`
13
+ }
14
+ end
@@ -0,0 +1 @@
1
+ require 'aruba/cucumber'
@@ -0,0 +1,97 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{git_pivotal_tracker_x}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Philippe Huibonhoa"]
12
+ s.date = %q{2011-10-27}
13
+ s.description = %q{Provides a set of git workflow tools to start and finish Pivotal Tracker stories in topic branches}
14
+ s.email = %q{phuibonhoa@gmail.com}
15
+ s.executables = ["commit-msg", "git-bug", "git-chore", "git-feature", "git-finish", "git-info", "git-story"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".rvmrc",
22
+ "Gemfile",
23
+ "LICENSE",
24
+ "README.md",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "bin/commit-msg",
28
+ "bin/git-bug",
29
+ "bin/git-chore",
30
+ "bin/git-feature",
31
+ "bin/git-finish",
32
+ "bin/git-info",
33
+ "bin/git-story",
34
+ "cucumber.yml",
35
+ "features/diagnostics.feature",
36
+ "features/getting_started.feature",
37
+ "features/hooks/aruba.rb",
38
+ "features/step_definitions/git_steps.rb",
39
+ "features/support/env.rb",
40
+ "git_pivotal_tracker_x.gemspec",
41
+ "lib/git_pivotal_tracker.rb",
42
+ "lib/git_pivotal_tracker/base.rb",
43
+ "lib/git_pivotal_tracker/finish.rb",
44
+ "lib/git_pivotal_tracker/info.rb",
45
+ "lib/git_pivotal_tracker/story.rb",
46
+ "spec/fixtures/finish_story.xml",
47
+ "spec/fixtures/no_stories.xml",
48
+ "spec/fixtures/one_story.xml",
49
+ "spec/fixtures/project.xml",
50
+ "spec/fixtures/start_story.xml",
51
+ "spec/fixtures/story.xml",
52
+ "spec/git_pivotal_tracker/base_spec.rb",
53
+ "spec/git_pivotal_tracker/finish_spec.rb",
54
+ "spec/git_pivotal_tracker/info_spec.rb",
55
+ "spec/git_pivotal_tracker/story_spec.rb",
56
+ "spec/spec_helper.rb"
57
+ ]
58
+ s.homepage = %q{http://github.com/phuibonhoa/git_pivotal_tracker}
59
+ s.licenses = ["MIT"]
60
+ s.require_paths = ["lib"]
61
+ s.rubygems_version = %q{1.6.2}
62
+ s.summary = %q{A git workflow integrated with Pivotal Tracker}
63
+
64
+ if s.respond_to? :specification_version then
65
+ s.specification_version = 3
66
+
67
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
68
+ s.add_runtime_dependency(%q<grit>, [">= 0"])
69
+ s.add_runtime_dependency(%q<pivotal-tracker>, [">= 0"])
70
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
71
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
72
+ s.add_development_dependency(%q<rcov>, [">= 0"])
73
+ s.add_development_dependency(%q<rspec>, [">= 0"])
74
+ s.add_development_dependency(%q<cucumber>, [">= 0"])
75
+ s.add_development_dependency(%q<webmock>, [">= 0"])
76
+ else
77
+ s.add_dependency(%q<grit>, [">= 0"])
78
+ s.add_dependency(%q<pivotal-tracker>, [">= 0"])
79
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
80
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
81
+ s.add_dependency(%q<rcov>, [">= 0"])
82
+ s.add_dependency(%q<rspec>, [">= 0"])
83
+ s.add_dependency(%q<cucumber>, [">= 0"])
84
+ s.add_dependency(%q<webmock>, [">= 0"])
85
+ end
86
+ else
87
+ s.add_dependency(%q<grit>, [">= 0"])
88
+ s.add_dependency(%q<pivotal-tracker>, [">= 0"])
89
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
90
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
91
+ s.add_dependency(%q<rcov>, [">= 0"])
92
+ s.add_dependency(%q<rspec>, [">= 0"])
93
+ s.add_dependency(%q<cucumber>, [">= 0"])
94
+ s.add_dependency(%q<webmock>, [">= 0"])
95
+ end
96
+ end
97
+