Open rturam opened 5 years ago
What are the git --version
s on each of the machines?
I have the same issue on fresh cloned repos. If I commit anything in the same repo where I use git-repo-info, the issue disappear. With other words, on the same machine (Ubuntu 18.04), cloning the repo twice in two different directories, if I don't commit any thing in a repo-instance, I get the issue within this repo-instance.
Seems plausible that the clone doesn't include tags by default? Can you try git pull --tags
on the machine that isn't showing them?
After a fresh cloning and some git-pulls, I see the bug:
git clone https://github.com/charlyoleg/rouleau git pull git pull --tags
Then git-repo-info provides: { sha: '39af95c9d6db684a914601971a1a1c5a9da8824e', abbreviatedSha: '39af95c9d6', branch: 'master', tag: null, committer: null, committerDate: null, author: null, authorDate: null, commitMessage: null, root: '/home/charli/Bis/Tmp/test_bug_repo_info/client7/rouleau', commonGitDir: '/home/charli/Bis/Tmp/test_bug_repo_info/client7/rouleau/.git', worktreeGitDir: '/home/charli/Bis/Tmp/test_bug_repo_info/client7/rouleau/.git', lastTag: null, commitsSinceLastTag: Infinity }
More interesting, if the git-pull contains new commits, the bug is then gone: { sha: '822fa931f759b4f6523de6b576485b796c6d8a67', abbreviatedSha: '822fa931f7', branch: 'master', tag: null, committer: 'charli charlyoleg@fabfolk.com', committerDate: '2019-07-03T20:28:39.000Z', author: 'charli charlyoleg@fabfolk.com', authorDate: '2019-07-03T20:28:39.000Z', commitMessage: 'a dummy commit for bug investigation', root: '/home/charli/Bis/Tmp/test_bug_repo_info/client7/rouleau', commonGitDir: '/home/charli/Bis/Tmp/test_bug_repo_info/client7/rouleau/.git', worktreeGitDir: '/home/charli/Bis/Tmp/test_bug_repo_info/client7/rouleau/.git', lastTag: null, commitsSinceLastTag: Infinity, parents: [ '39af95c9d6db684a914601971a1a1c5a9da8824e' ] }
Might it be something related to the missing parents after a fresh clone?
A short way to reproduce the issue: bash> git clone https://github.com/rwjblue/git-repo-info bash> cd git-repo-info bash> npm i bash> nodejs nodejs> const gitRepoInfo = require('./index'); nodejs> a=gitRepoInfo();
You will see: { sha: '416f9816d4883c74f91ac44c7bfbb956d569675a', abbreviatedSha: '416f9816d4', branch: 'master', tag: null, committer: null, committerDate: null, author: null, authorDate: null, commitMessage: null, root: '/home/charli/Bis/Tmp/ttt/git-repo-info', commonGitDir: '/home/charli/Bis/Tmp/ttt/git-repo-info/.git', worktreeGitDir: '/home/charli/Bis/Tmp/ttt/git-repo-info/.git', lastTag: null, commitsSinceLastTag: Infinity }
Using git version 2.17.1 nodejs v8.10.0
Doesn't work for me either - lastTag
is always null
I am using git-rev-sync-js
as a replacement.
Any new information on this? This was working for me and then suddenly only lastTag
is null now
Hello,
For one repository the tag information is shown correctly on mac and windows but not on Amazon Linux. What can be the issue? How to debug?
I am running this code:
ON MAC:
On Amazon linux (this is run jenkins slave machine - the code checkout and everything done in jenkisfile.)