gtm-core

command module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 5 Imported by: 0

README

Based on https://github.com/git-time-metric/gtm

logo

Seamless time tracking for all your Git projects

Release Develop

Installation

See wiki: https://github.com/DEVELOPEST/gtm-core/wiki/Installation

$ gtm report -last-month
$ gtm report -last-month -format summary
$ gtm report -last-month -format timeline-hours

GTM is automatic, seamless and lightweight. There is no need to remember to start and stop timers. It runs on occasion to capture activity triggered by your editor. The time metrics are stored locally with the git repository as Git notes and can be pushed to the remote repository.

Plugins

Simply install a plugin for your favorite editor and the GTM command line utility to start tracking your time now.

Initialize a project for time tracking

$ cd /my/project/dir
$ gtm init

Git Time Metric initialized for /my/project/dir

         post-commit: gtm commit --yes
            pre-push: git push origin refs/notes/gtm-data --no-verify
      alias.fetchgtm: fetch origin refs/notes/gtm-data:refs/notes/gtm-data
       alias.pushgtm: push origin refs/notes/gtm-data
   notes.rewriteMode: concatenate
    notes.rewriteRef: refs/notes/gtm-data
       add fetch ref: +refs/notes/gtm-data:refs/notes/gtm-data
            terminal: true
          .gitignore: /.gtm/
                tags: tag1, tag2

Edit some files in your project

Check your progress with gtm status.

$ gtm status

       20m 40s  53% [m] plugin/gtm.vim
       18m  5s  46% [r] Terminal
           15s   1% [m] .gitignore
       39m  0s          gtm-vim-plugin 

Commit your work

When you are ready, commit your work like you usually do. GTM will automatically save the time spent associated with your commit. To check the time of the last commit type gtm report.

$ gtm report

7129f00 Remove post processing of status
Fri Sep 09 20:45:03 2016 -0500 gtm-vim-plugin Michael Schenk

       20m 40s  53% [m] plugin/gtm.vim
       18m  5s  46% [r] Terminal
           15s   1% [m] .gitignore
       39m  0s          gtm-vim-plugin 

Optionally save time in the remote Git repository

GTM provides git aliases to make this easy. It defaults to origin for the remote repository.

Time data can be saved to the remote repository by pushing.

$ git pushgtm 

Time data can be retrieved from the remote repository by fetching.

$ git fetchgtm 

Getting Help

For help from the command line type gtm --help and gtm <subcommand> --help.

For additional help please consult the Wiki.

Contributing

If you find a bug or have an idea for a new feature please feel free to file new issues and submits PRs.
See CONTRIBUTING.md for more detailed information!

Building from source

Install go

You can follow any go installation tutorial, one for Ubuntu for example: https://medium.com/golang-basics/installing-go-on-ubuntu-b443a8f0eb55

Install apt dependencies

sudo apt-get install libgit2-dev libssh2-1-dev libssl-dev cmake

Clone gtm-core

git clone https://github.com/DEVELOPEST/gtm-core.git
mv gtm-core $GOPATH/src/github.com/DEVELOPEST/
cd $GOPATH/src/github.com/DEVELOPEST/gtm-core
git submodule update --init  # Install vendor dependecies

Install dependencies

go get -d github.com/Masterminds/sprig
go get -d github.com/libgit2/git2go
cd $GOPATH/src/github.com/libgit2/git2go
git submodule update --init  # get libgit2
cd vendor/libgit2
mkdir build && cd build
cmake ..
make
sudo make install
cd ../../..
make install-static

Build

cd $GOPATH/src/github.com/DEVELOPEST/gtm-core
mkdir build
go build -o build/ ./...

Support

To report a bug, please submit an issue on the GitHub Page

Consult the Wiki for more information.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL