Giter Club home page Giter Club logo

Comments (9)

mschenk42 avatar mschenk42 commented on May 30, 2024

Did you run gtm init from within the root directory of an already initialized git repo? Here's how you can test if it's working correctly.

  • git init
  • gtm init
  • edit some files in your editor
  • gtm status
  • git add/commit
  • gtm report

from gtm.

akougblenou avatar akougblenou commented on May 30, 2024

Yes it was in a an already initialized repo.
git init returns the error I mentionned previously and the other gtmcommands returns Git Time Metric is not initialized, is it not possible to use it in an already initialized repo ?

from gtm.

mschenk42 avatar mschenk42 commented on May 30, 2024

GTM does not work with bare git repos, i.e. git init --bare. I'm guessing that is what the issue is. You can check this by looking for the .git hidden directory in the root. If it doesn't exist it's been initialized as a bare repo.

from gtm.

akougblenou avatar akougblenou commented on May 30, 2024

There is a .git in both all the repo I have tested this. Any other thoughts ?

from gtm.

mschenk42 avatar mschenk42 commented on May 30, 2024

Let's determine if it's an issue with just this repo or in general for all repos. Can you try creating a new git repo and initialize gtm? If would be helpful if you could also share the .git/config file for the repo that has been problematic.

from gtm.

akougblenou avatar akougblenou commented on May 30, 2024

I tried with a newly initialized repo and it worked but it does not seem to work on existing repo (it is a shared repo by the way).

And here I shared with you the .gitconfig of the problematic repo (I had to hide some of the facts as it s not my personal repo), the file is truncated but the rest of the file only contains remote branches config

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true
[remote "origin"]
	url = ************
	fetch = +refs/heads/*:refs/remotes/origin/*

from gtm.

mschenk42 avatar mschenk42 commented on May 30, 2024

I don't see anything out of the ordinary for the git configuration.

To make sure I understand the issue, do you get the "No files need merging" when running gtm init or after initializing the repo and then trying to add/commit files?

You should see something similar to this when running gtm init

Git Time Metric initialized for /Users/mschenk/Projects/platform-chef

     post-commit: gtm commit --yes
  alias.fetchgtm: fetch origin refs/notes/gtm-data:refs/notes/gtm-data
   alias.pushgtm: push origin refs/notes/gtm-data
notes.rewriteref: refs/notes/gtm-data
        terminal: true
      .gitignore: /.gtm/
            tags:

I have a few things for you to check.

  1. Try running gtm status after editing some files in your editor with the gtm plugin. If it's recording properly you should see some time reported.

  2. Check to see if the .git/hooks/post-commit contains gtm. If you can, please share the contents of this file. This hook is what records the time in a git note associated with the commit. If this is not firing properly you will not see time when running gtm report.

Note - there is bug I addressed in the last release (just the other day) that sets the full path for gtm in the post-commit hook. You can see more here #54.

from gtm.

akougblenou avatar akougblenou commented on May 30, 2024

Ok I really don't know why, but it seems like it is working now...
Possible answer would be me from node v5 to node v6.9.0, but I am not really anyway I retried gtm init on an existing repo and it worked fine!

from gtm.

mschenk42 avatar mschenk42 commented on May 30, 2024

Good to hear. 👍

from gtm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.