git-pivotal-tracker-integration 1.1.0 → 1.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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -1
  3. data/bin/git-finish +16 -2
  4. data/bin/git-release +19 -0
  5. data/bin/git-start +16 -2
  6. data/lib/git-pivotal-tracker-integration/command/base.rb +47 -0
  7. data/lib/git-pivotal-tracker-integration/{base.rb → command/command.rb} +3 -14
  8. data/lib/git-pivotal-tracker-integration/command/configuration.rb +92 -0
  9. data/lib/git-pivotal-tracker-integration/command/finish.rb +36 -0
  10. data/lib/git-pivotal-tracker-integration/command/prepare-commit-msg.sh +26 -0
  11. data/lib/git-pivotal-tracker-integration/command/release.rb +56 -0
  12. data/lib/git-pivotal-tracker-integration/command/start.rb +64 -0
  13. data/lib/git-pivotal-tracker-integration/util/git.rb +242 -0
  14. data/lib/git-pivotal-tracker-integration/util/shell.rb +36 -0
  15. data/lib/git-pivotal-tracker-integration/util/story.rb +128 -0
  16. data/lib/git-pivotal-tracker-integration/util/util.rb +20 -0
  17. data/lib/git-pivotal-tracker-integration/version-update/gradle.rb +64 -0
  18. data/lib/git-pivotal-tracker-integration/version-update/version_update.rb +20 -0
  19. data/lib/git_pivotal_tracker_integration.rb +18 -0
  20. data/spec/git-pivotal-tracker-integration/command/base_spec.rb +38 -0
  21. data/spec/git-pivotal-tracker-integration/command/configuration_spec.rb +91 -0
  22. data/spec/git-pivotal-tracker-integration/command/finish_spec.rb +45 -0
  23. data/spec/git-pivotal-tracker-integration/command/release_spec.rb +57 -0
  24. data/spec/git-pivotal-tracker-integration/command/start_spec.rb +50 -0
  25. data/spec/git-pivotal-tracker-integration/util/git_spec.rb +239 -0
  26. data/spec/git-pivotal-tracker-integration/util/shell_spec.rb +52 -0
  27. data/spec/git-pivotal-tracker-integration/util/story_spec.rb +137 -0
  28. data/spec/git-pivotal-tracker-integration/version-update/gradle_spec.rb +74 -0
  29. metadata +104 -21
  30. data/lib/git-pivotal-tracker-integration/finish.rb +0 -106
  31. data/lib/git-pivotal-tracker-integration/pivotal_configuration.rb +0 -90
  32. data/lib/git-pivotal-tracker-integration/prepare-commit-msg.sh +0 -12
  33. data/lib/git-pivotal-tracker-integration/start.rb +0 -167
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a4c85be1137c7421af33a78659d9b9249533e1a
4
- data.tar.gz: 00fd6f4fb8ebc93a351bfa7207d7f0d641f342f8
3
+ metadata.gz: af83c4208875d093dba4ab8cd22ea6f157179c41
4
+ data.tar.gz: ac6a9da4a881480cceca563859bbfce3016b572f
5
5
  SHA512:
6
- metadata.gz: 3818abcd8243550a5edcd0449c0d1289b3ada53af8a0730522da9d37d9badf782915ab65f32614e83545226ed6d2ceff6762f5978ecb19f5a123f4f01b4a12f2
7
- data.tar.gz: 441b962e073172b9035c7e052cdcc2f92878d9dad403c6ca9f5c4d6791fa21f312ef97b88c5e43c421cd6da93bbb831a299f049e30ca93fc08eae189eb1344e2
6
+ metadata.gz: 5e6a3d913df8b5c473aa16eb8d624d7e9abec62dd10cf959195f41c68c90b5bb48c253c5aacf858be6d4917705edfc7fbf9b4bc2d40bd5476985b06028f4a92c
7
+ data.tar.gz: 8ff57d1fd8e35a4d28803a522612ee77dada8c74ecc1746e5c1d0279e875cec4db3f64b3f4f9fc2695a5ab0b73808e75dabc15ec876eff89d2288e39ce658b49
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # Git Pivotal Tracker Integration
2
+ [![Gem Version](https://badge.fury.io/rb/git-pivotal-tracker-integration.png)](http://badge.fury.io/rb/git-pivotal-tracker-integration)
3
+ [![Build Status](https://travis-ci.org/nebhale/git-pivotal-tracker-integration.png?branch=master)](https://travis-ci.org/nebhale/git-pivotal-tracker-integration)
2
4
 
3
5
  `git-pivotal-tracker-integration` provides a set of additional Git commands to help developers when working with [Pivotal Tracker][pivotal-tracker].
4
6
 
@@ -6,7 +8,7 @@
6
8
 
7
9
 
8
10
  ## Installation
9
- `git-pivotal-tracker-integration` requires at least **Ruby 2.0.0** and **Git 1.8.2.1** in order to run. In order to install it, do the following:
11
+ `git-pivotal-tracker-integration` requires at least **Ruby 1.8.7** and **Git 1.8.2.1** in order to run. It is tested against Rubies _1.8.7_, _1.9.3_, and _2.0.0_. In order to install it, do the following:
10
12
 
11
13
  ```plain
12
14
  $ gem install git-pivotal-tracker-integration
@@ -133,3 +135,34 @@ Merge 12345678-lorem-ipsum to master
133
135
  ```
134
136
 
135
137
  After merging, the development branch is deleted and the changes are pushed to the remote repository.
138
+
139
+ ### `git release [issue]`
140
+ This command creates a release for a story. It does this by updating the version string in the project and creating a tag. This command can be run in two ways. First it can be run specifying the release that you want to create.
141
+
142
+ ```plain
143
+ $ git release 12345678
144
+ ```
145
+ The other way the command can be run without specifying anything. In this case, it will select the first release story (based on the backlog's order).
146
+
147
+ ```plain
148
+ $ git release
149
+ Title: Lorem ipsum dolor sit amet, consectetur adipiscing elitattributes
150
+ ```
151
+
152
+ Once a story has been selected by one of the two methods, the command then prompts for the release version and next development version.
153
+
154
+ ```plain
155
+ $ git release
156
+ Title: Lorem ipsum dolor sit amet, consectetur adipiscing elitattributes
157
+
158
+ Enter release version (current: 1.0.0.BUILD-SNAPSHOT): 1.0.0.M1
159
+ Enter next development version (current: 1.0.0.BUILD-SNAPSHOT): 1.1.0.BUILD-SNAPSHOT
160
+ Creating tag v1.0.0.M1... OK
161
+ Pushing to origin... OK
162
+ ```
163
+
164
+ Once these have been entered, the version string for the current project is updated to the release version and a tag is created. Then the version string for the current project is updated to the next development version and a new commit along the original branch is created. Finally the tag and changes are pushed to the remote sever.
165
+
166
+ Version update is currently supported for the following kinds of projects. If you do not see a project type that you would like supported, please open an issue or submit a pull request.
167
+
168
+ * Gradle
data/bin/git-finish CHANGED
@@ -1,5 +1,19 @@
1
1
  #!/usr/bin/env ruby -U
2
+ # Git Pivotal Tracker Integration
3
+ # Copyright (c) 2013 the original author or authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
2
16
 
3
- require "git-pivotal-tracker-integration/finish"
17
+ require "git-pivotal-tracker-integration/command/finish"
4
18
 
5
- Finish.new().run
19
+ GitPivotalTrackerIntegration::Command::Finish.new().run
data/bin/git-release ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby -U
2
+ # Git Pivotal Tracker Integration
3
+ # Copyright (c) 2013 the original author or authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "git-pivotal-tracker-integration/command/release"
18
+
19
+ GitPivotalTrackerIntegration::Command::Release.new().run ARGV[0]
data/bin/git-start CHANGED
@@ -1,5 +1,19 @@
1
1
  #!/usr/bin/env ruby -U
2
+ # Git Pivotal Tracker Integration
3
+ # Copyright (c) 2013 the original author or authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
2
16
 
3
- require "git-pivotal-tracker-integration/start"
17
+ require "git-pivotal-tracker-integration/command/start"
4
18
 
5
- Start.new(ARGV).run
19
+ GitPivotalTrackerIntegration::Command::Start.new().run ARGV[0]
@@ -0,0 +1,47 @@
1
+ # Git Pivotal Tracker Integration
2
+ # Copyright (c) 2013 the original author or authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "git-pivotal-tracker-integration/command/command"
17
+ require "git-pivotal-tracker-integration/command/configuration"
18
+ require "git-pivotal-tracker-integration/util/git"
19
+ require "pivotal-tracker"
20
+
21
+ # An abstract base class for all commands
22
+ # @abstract Subclass and override {#run} to implement command functionality
23
+ class GitPivotalTrackerIntegration::Command::Base
24
+
25
+ # Common initialization functionality for all command classes. This
26
+ # enforces that:
27
+ # * the command is being run within a valid Git repository
28
+ # * the user has specified their Pivotal Tracker API token
29
+ # * all communication with Pivotal Tracker will be protected with SSL
30
+ # * the user has configured the project id for this repository
31
+ def initialize
32
+ @repository_root = GitPivotalTrackerIntegration::Util::Git.repository_root
33
+ @configuration = GitPivotalTrackerIntegration::Command::Configuration.new
34
+
35
+ PivotalTracker::Client.token = @configuration.api_token
36
+ PivotalTracker::Client.use_ssl = true
37
+
38
+ @project = PivotalTracker::Project.find @configuration.project_id
39
+ end
40
+
41
+ # The main entry point to the command's execution
42
+ # @abstract Override this method to implement command functionality
43
+ def run
44
+ raise NotImplementedError
45
+ end
46
+
47
+ end
@@ -13,19 +13,8 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- require "git-pivotal-tracker-integration/pivotal_configuration"
17
- require "pivotal-tracker"
18
-
19
- class Base
20
-
21
- def initialize
22
- PivotalTracker::Client.token = PivotalConfiguration.api_token
23
- PivotalTracker::Client.use_ssl = true
24
- @project = PivotalTracker::Project.find PivotalConfiguration.project_id
25
- end
26
-
27
- def current_branch
28
- `git branch`.scan(/\* (.*)/)[0][0]
29
- end
16
+ require "git_pivotal_tracker_integration"
30
17
 
18
+ # A module encapsulating the commands for the project
19
+ module GitPivotalTrackerIntegration::Command
31
20
  end
@@ -0,0 +1,92 @@
1
+ # Git Pivotal Tracker Integration
2
+ # Copyright (c) 2013 the original author or authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "git-pivotal-tracker-integration/command/command"
17
+ require "git-pivotal-tracker-integration/util/git"
18
+ require "highline/import"
19
+ require "pivotal-tracker"
20
+
21
+ # A class that exposes configuration that commands can use
22
+ class GitPivotalTrackerIntegration::Command::Configuration
23
+
24
+ # Returns the user's Pivotal Tracker API token. If this token has not been
25
+ # configured, prompts the user for the value. The value is checked for in
26
+ # the _inherited_ Git configuration, but is stored in the _global_ Git
27
+ # configuration so that it can be used across mutiple repositories.
28
+ #
29
+ # @return [String] The user's Pivotal Tracker API token
30
+ def api_token
31
+ api_token = GitPivotalTrackerIntegration::Util::Git.get_config @@KEY_API_TOKEN, :inherited
32
+
33
+ if api_token.empty?
34
+ api_token = ask("Pivotal API Token (found at https://www.pivotaltracker.com/profile): ").strip
35
+ GitPivotalTrackerIntegration::Util::Git.set_config @@KEY_API_TOKEN, api_token, :global
36
+ puts
37
+ end
38
+
39
+ api_token
40
+ end
41
+
42
+ # Returns the Pivotal Tracker project id for this repository. If this id
43
+ # has not been configuration, prompts the user for the value. The value is
44
+ # checked for in the _inherited_ Git configuration, but is stored in the
45
+ # _local_ Git configuration so that it is specific to this repository.
46
+ #
47
+ # @return [String] The repository's Pivotal Tracker project id
48
+ def project_id
49
+ project_id = GitPivotalTrackerIntegration::Util::Git.get_config @@KEY_PROJECT_ID, :inherited
50
+
51
+ if project_id.empty?
52
+ project_id = choose do |menu|
53
+ menu.prompt = "Choose project associated with this repository: "
54
+
55
+ PivotalTracker::Project.all.sort_by { |project| project.name }.each do |project|
56
+ menu.choice(project.name) { project.id }
57
+ end
58
+ end
59
+
60
+ GitPivotalTrackerIntegration::Util::Git.set_config @@KEY_PROJECT_ID, project_id, :local
61
+ puts
62
+ end
63
+
64
+ project_id
65
+ end
66
+
67
+ # Returns the story associated with the current development branch
68
+ #
69
+ # @param [PivotalTracker::Project] project the project the story belongs to
70
+ # @return [PivotalTracker::Story] the story assocated with the current development branch
71
+ def story(project)
72
+ story_id = GitPivotalTrackerIntegration::Util::Git.get_config @@KEY_STORY_ID, :branch
73
+ project.stories.find story_id.to_i
74
+ end
75
+
76
+ # Stores the story associated with the current development branch
77
+ #
78
+ # @param [PivotalTracker::Story] story the story assocated with the current development branch
79
+ # @return [void]
80
+ def story=(story)
81
+ GitPivotalTrackerIntegration::Util::Git.set_config @@KEY_STORY_ID, story.id, :branch
82
+ end
83
+
84
+ private
85
+
86
+ @@KEY_API_TOKEN = "pivotal.api-token"
87
+
88
+ @@KEY_PROJECT_ID = "pivotal.project-id"
89
+
90
+ @@KEY_STORY_ID = "pivotal-story-id"
91
+
92
+ end
@@ -0,0 +1,36 @@
1
+ # Git Pivotal Tracker Integration
2
+ # Copyright (c) 2013 the original author or authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "git-pivotal-tracker-integration/command/base"
17
+ require "git-pivotal-tracker-integration/command/command"
18
+ require "git-pivotal-tracker-integration/util/git"
19
+
20
+ # The class that encapsulates finishing a Pivotal Tracker Story
21
+ class GitPivotalTrackerIntegration::Command::Finish < GitPivotalTrackerIntegration::Command::Base
22
+
23
+ # Finishes a Pivotal Tracker story by doing the following steps:
24
+ # * Check that the pending merge will be trivial
25
+ # * Merge the development branch into the root branch
26
+ # * Delete the development branch
27
+ # * Push changes to remote
28
+ #
29
+ # @return [void]
30
+ def run
31
+ GitPivotalTrackerIntegration::Util::Git.trivial_merge?
32
+ GitPivotalTrackerIntegration::Util::Git.merge(@configuration.story @project)
33
+ GitPivotalTrackerIntegration::Util::Git.push GitPivotalTrackerIntegration::Util::Git.branch_name
34
+ end
35
+
36
+ end
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+ # Git Pivotal Tracker Integration
3
+ # Copyright (c) 2013 the original author or authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ CURRENT_BRANCH=$(git branch | grep "*" | sed "s/* //")
18
+ STORY_ID=$(git config branch.$CURRENT_BRANCH.pivotal-story-id)
19
+
20
+ if [[ $2 != "commit" && -n $STORY_ID ]]; then
21
+ ORIG_MSG_FILE="$1"
22
+ TEMP=$(mktemp /tmp/git-XXXXX)
23
+
24
+ (printf "\n\n[#$STORY_ID]" ; cat "$1") > "$TEMP"
25
+ cat "$TEMP" > "$ORIG_MSG_FILE"
26
+ fi
@@ -0,0 +1,56 @@
1
+ # Git Pivotal Tracker Integration
2
+ # Copyright (c) 2013 the original author or authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "git-pivotal-tracker-integration/command/base"
17
+ require "git-pivotal-tracker-integration/command/command"
18
+ require "git-pivotal-tracker-integration/util/git"
19
+ require "git-pivotal-tracker-integration/util/story"
20
+ require "git-pivotal-tracker-integration/version-update/gradle"
21
+
22
+ # The class that encapsulates releasing a Pivotal Tracker Story
23
+ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegration::Command::Base
24
+
25
+ # Releases a Pivotal Tracker story by doing the following steps:
26
+ # * Update the version to the release version
27
+ # * Create a tag for the release version
28
+ # * Update the version to the new development version
29
+ # * Push tag and changes to remote
30
+ #
31
+ # @param [String, nil] filter a filter for selecting the release to start. This
32
+ # filter can be either:
33
+ # * a story id
34
+ # * +nil+
35
+ # @return [void]
36
+ def run(filter)
37
+ story = GitPivotalTrackerIntegration::Util::Story.select_story(@project, filter.nil? ? "release" : filter, 1)
38
+ GitPivotalTrackerIntegration::Util::Story.pretty_print story
39
+
40
+ updater = [
41
+ GitPivotalTrackerIntegration::VersionUpdate::Gradle.new(@repository_root)
42
+ ].find { |candidate| candidate.supports? }
43
+
44
+ current_version = updater.current_version
45
+ release_version = ask("Enter release version (current: #{current_version}): ")
46
+ next_version = ask("Enter next development version (current: #{current_version}): ")
47
+
48
+ updater.update_version release_version
49
+ GitPivotalTrackerIntegration::Util::Git.create_release_tag release_version, story
50
+ updater.update_version next_version
51
+ GitPivotalTrackerIntegration::Util::Git.create_commit "#{next_version} Development", story
52
+
53
+ GitPivotalTrackerIntegration::Util::Git.push GitPivotalTrackerIntegration::Util::Git.branch_name, "v#{release_version}"
54
+ end
55
+
56
+ end
@@ -0,0 +1,64 @@
1
+ # Git Pivotal Tracker Integration
2
+ # Copyright (c) 2013 the original author or authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "git-pivotal-tracker-integration/command/base"
17
+ require "git-pivotal-tracker-integration/command/command"
18
+ require "git-pivotal-tracker-integration/util/git"
19
+ require "git-pivotal-tracker-integration/util/story"
20
+ require "pivotal-tracker"
21
+
22
+ # The class that encapsulates starting a Pivotal Tracker Story
23
+ class GitPivotalTrackerIntegration::Command::Start < GitPivotalTrackerIntegration::Command::Base
24
+
25
+ # Starts a Pivotal Tracker story by doing the following steps:
26
+ # * Create a branch
27
+ # * Add default commit hook
28
+ # * Start the story on Pivotal Tracker
29
+ #
30
+ # @param [String, nil] filter a filter for selecting the story to start. This
31
+ # filter can be either:
32
+ # * a story id
33
+ # * a story type (feature, bug, chore)
34
+ # * +nil+
35
+ # @return [void]
36
+ def run(filter)
37
+ story = GitPivotalTrackerIntegration::Util::Story.select_story @project, filter
38
+
39
+ GitPivotalTrackerIntegration::Util::Story.pretty_print story
40
+
41
+ development_branch_name = development_branch_name story
42
+ GitPivotalTrackerIntegration::Util::Git.create_branch development_branch_name
43
+ @configuration.story = story
44
+
45
+ GitPivotalTrackerIntegration::Util::Git.add_hook "prepare-commit-msg", File.join(File.dirname(__FILE__), "prepare-commit-msg.sh")
46
+
47
+ start_on_tracker story
48
+ end
49
+
50
+ private
51
+
52
+ def development_branch_name(story)
53
+ branch_name = "#{story.id}-" + ask("Enter branch name (#{story.id}-<branch-name>): ")
54
+ puts
55
+ branch_name
56
+ end
57
+
58
+ def start_on_tracker(story)
59
+ print "Starting story on Pivotal Tracker... "
60
+ story.update(:current_state => "started")
61
+ puts "OK"
62
+ end
63
+
64
+ end