Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewing all tasks associated with a story when using 'git info' #41

Open
brenzenb opened this issue Nov 28, 2011 · 2 comments
Open

Viewing all tasks associated with a story when using 'git info' #41

brenzenb opened this issue Nov 28, 2011 · 2 comments
Labels

Comments

@brenzenb
Copy link

Is there a way to view all of the story-level tasks when calling 'git info' ?

If I have a story created in Pivotal with 5 tasks, I'd like to be able to see a list of these stories when calling 'git info'. I'd love to also be able to mark a task as complete from the command line tool, but that less of a priority for me.

@brenzenb
Copy link
Author

After playing around a bit, I was able to manipulate the 'git info' output via the 'info.rb' file. I successfully added in label information, but the API call for a Story's task isn't returning actual tasks. Here's the new code:

require 'commands/base'

module Commands
  class Info < Base

    def run!
      super

      unless story_id
        put "Branch name must contain a Pivotal Tracker story id"
        return 1
      end

      put "Story:         #{story.name}"
      put "URL:           #{story.url}"
      put "Labels:        #{story.labels}"
      put "Description:   #{story.description}"
      put "Tasks:         #{story.tasks}"    
      return 0
    end

 protected

    def story_id
      current_branch[/\d+/].to_i
    end

    def story
      @story ||= project.stories.find(story_id)
    end
  end
end

And the output ends up looking like this:

Story: This is a generic story title
URL: http://www.pivotaltracker.com/story/show/123456789
Labels: testing, qa
Description: Examine a test story using git-pivotal

Tasks: PivotalTracker::Task

Anyone know why the {story.tasks} reference only outputs "PivotalTracker::Task"? The story I'm referencing has two separate tasks.

@addynaik
Copy link
Collaborator

addynaik commented Feb 2, 2012

try this..
https://gist.github.com/1725163

this is a great idea.. can you put it in a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants