git-time-metric / gtm

Simple, seamless, lightweight time tracking for Git
MIT License
979 stars 52 forks source link

Total time spent in project #77

Closed cgoliver closed 6 years ago

cgoliver commented 6 years ago

Hello,

Is there a command to get the total time spent on the project?

Thanks!

mschenk42 commented 6 years ago

No but I'll add this as a feature request.

cgoliver commented 6 years ago

Thanks! Would you have an idea on how to get that information with the current state of the tool? I was using it to keep track of my hours to know how much to charge for a project so in the meantime it would be nice to still be able to get that information.

mschenk42 commented 6 years ago

I may have misunderstood your question. I assume you wanted a report option that just gives you total hours for the entire Git project. There are several options for reporting time. I especially like the --format summary option.

Usage: gtm report [options] <Commit-ID>...

  Display reports for one or more git repositories.

Options:

  Report Formats:

  -format=commits            Specify report format [summary|commits|files|timeline-hours|timeline-commits] (default commits)
  -full-message=false        Include full commit message
  -terminal-off=false        Exclude time spent in terminal (Terminal plug-in is required)
  -force-color=false         Always output color even if no terminal is detected, i.e 'gtm report -color | less -R'
  -testing=false             This is used for automated testing to force default test path

  Commit Limiting:

  -n int=1                   Limit output, 0 is no limits, defaults to 1 when no limiting flags otherwise defaults to 0
  -from-date=yyyy-mm-dd      Show commits starting from this date
  -to-date=yyyy-mm-dd        Show commits thru the end of this date
  -author=""                 Show commits which contain author substring
  -message=""                Show commits which contain message substring
  -today=false               Show commits for today
  -yesterday=false           Show commits for yesterday
  -this-week=false           Show commits for this week
  -last-week=false           Show commits for last week
  -this-month=false          Show commits for this month
  -last-month=false          Show commits for last month
  -this-year=false           Show commits for this year
  -last-year=false           Show commits for last year

  Multi-Project Reporting:

  -tags=""                   Project tags to report on, i.e --tags tag1,tag2
  -all=false                 Show commits for all projects
cgoliver commented 6 years ago

No you understood correctly. I wanted total time spent on the whole project (not just a particular commit or time window like week or month) so I guess it's just the sum of all the times spent on each commit. I was just wondering if maybe there was a somewhat simple way to get that from some manipulation of the current state of the tool.

mschenk42 commented 6 years ago

@cgoliver I added this feature in the latest release v1.3.0 gtm report --format project