File: recent.rb

package info (click to toggle)
ticgit 1.0.2.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 488 kB
  • sloc: ruby: 2,848; sh: 124; makefile: 16
file content (29 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module TicGitNG
  module Command
    module Recent
      def parser(opts)
        opts.banner = 'Usage: ti recent'
      end

      def execute
        # "args[0]" seems to be superfluous.  It's usage
        # is undocumented, and supplying an argument
        # doesn't seem to do anything.
        #
        # Im guessing the purpose of args[0] was to provide a
        # specific ticket_id whos history would be looked up
        # intead of looking up the history for all tickets.
        #
        # #FIXME Reimplement that functionality and updte
        # docs to match
        tic.ticket_recent(args[0]).each do |commit|
          sha = commit.sha[0, 7]
          date = commit.date.strftime("%m/%d %H:%M")
          message = commit.message

          puts "#{sha}  #{date}\t#{message}"
        end
      end
    end
  end
end