ionicabizau / git-stats Goto Github PK
View Code? Open in Web Editor NEW๐ Local git statistics including GitHub-like contributions calendars.
License: MIT License
๐ Local git statistics including GitHub-like contributions calendars.
License: MIT License
My contribute data is not correctly displayed: I can see some commits in ~/.git-stats
are not shown. For example, there are many commits since 2016, but the calendar just showed one of them:
~/.git-stats
is attached here: git-stat.zip
Please make an option, so that all commits count not only the own.
$ git-stats
/usr/local/lib/node_modules/git-stats/lib/index.js:506
cDayObj = graph[cDay];
^ReferenceError: cDayObj is not defined
at /usr/local/lib/node_modules/git-stats/lib/index.js:506:21
at GitStats.iterateDays (/usr/local/lib/node_modules/git-stats/lib/index.js:371:9)
at /usr/local/lib/node_modules/git-stats/lib/index.js:505:14
at /usr/local/lib/node_modules/git-stats/lib/index.js:415:9
at /usr/local/lib/node_modules/git-stats/lib/index.js:316:9
at /usr/local/lib/node_modules/git-stats/node_modules/r-json/lib/index.js:23:13
at FSReqWrap.readFileAfterClose as oncomplete
When executing git-stats, the number of columns expected by the tool is always 1 bigger than the actual number of columns available (in the example the console has 100 columns, but the output fits into 101 columns). Changing the number of columns beforehand didn't change anything. Is there something that I'm missing as nobody else has this problem?
git has hooks, for example for commits.
They should also be globally usable, and this would be a way better entry point then to rewrite the shell commands
I did not see an uninstall process. What would be the best way to uninstall git-stats?
A good feature could be to add a command to export commit graph into an image file (jpeg/png) for easy sharing.
Something like "git-stats -exporttoimage" - you name it.
vadi@vadi-HP-ZBook-14 ~/Programs (master) $ git-stats
/usr/bin/env: node: No such file or directory
vadi@vadi-HP-ZBook-14 ~/Programs (master) $ node
node-gyp nodejs
vadi@vadi-HP-ZBook-14 ~/Programs (master) $ which git-stats
/usr/local/bin/git-stats
vadi@vadi-HP-ZBook-14 ~/Programs (master) $ cat /usr/local/bin/git-stats
#!/usr/bin/env node
How does one can graph current (working directory) repository commitments? Can git-stats
take this information from git log
?
I'm curious about your decision for making the remote url of the repository a requirement for a git stats record.
When I read "...but locally, with all your git commits.", I imagined that the graph would be aggregating data across all of my commits (at least the repositories I have imported). Many of my repositories are just kept locally -- they are not connected to any remotes.
Is git-stats intended to only aggregate public contributions?
Running the command here clobbers any existing hooks:
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
An improvement could be to make a note in the readme, or to modify the bash script to run append-only. Happy to make a PR for either.
Hello! Thank you for the great tool you made. I've installed it on my Mac, and it's awesome. Unfortunately there is Windows on my work laptop, and there I've got this sad message:
> git-stats-importer
error Cannot find the remote origin url. Please add it.
My .git/config file looks like this:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = [email protected]:foo/my-repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Is there something wrong?
It should show authors' contributions pie chart since that day to make sense, I think.
I get this when running git-stats:
error Error: ENOENT, open '/home/ionel/.git-stats'
Seems it doesn't create this file. What's going on here?
Details
$ node --version
v0.10.33
When you've got less columns in your terminal, you really want to see the most recent activity in detail rather than the earliest (1 year old).
So, in the attached screenshot, given the activity in the second calendar, the first (printed when the window was much narrower) should really show the most recent n months with left-side ellipses, rather than the older n months and right-side ellipses.
I installed the package like this (on Ubuntu 16.04):
sudo npm i -g git-stats
There were no errors and everything appeared to install OK.
Then I ran this script (as a regular user):
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
When I try to run the script, the command cannot be found:
$ git-stats
-su: git-stats: command not found
What I am missing? I'm not a node programmer, so something may be missing from my environment that node users assume is always there.
In README file, the link to github-stats
appears to be incorrect.
I was thinking it would be nice to have an data export option so that it could be used on a website.
You have to get at least half way through the readme to understand that the tool has to be run from within a repository. (at least that is my feeling).
It would be nice to have a section much earlier explaining that you have to move into a folder of a repo in order to get data.
Maybe a new section (the first obviously) under the Usage heading?
$ git-stats --authors
/usr/local/lib/node_modules/git-stats/lib/index.js:537
lines = stdout.split("\n");
^ReferenceError: lines is not defined
at /usr/local/lib/node_modules/git-stats/lib/index.js:537:15
at LimitIt. (/usr/local/lib/node_modules/git-stats/node_modules/gry/lib/index.js:73:9)
at /usr/local/lib/node_modules/git-stats/node_modules/limit-it/lib/index.js:138:20
at ChildProcess.exithandler (child_process.js:204:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:821:16)
at Socket. (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
multiple import of the same repository causes multiple entries for each commit, even if the commit IDs should be unique.
Thats only the visible problem, the true problem is, that git-stats --record
allows to record the same commit multiple times.
Using the commit ID as unique key should solve this, maybe also add the repo.url so we avoid cross repository ID conflicts(which statistically should never happen, for the same user)
As someone who uses Windows at work, I tried git-stats and it only logs the days on the calendar by highlighting the day, but does not show the density of commits.
The default cmd font, 'raster font', displays rectangles instead of squares. Changing the font to either 'Consolas' or 'Lucida Console' does display square boxes, but still does not show density of commits.
(Using CMD with 'Raster Font')
Using 'Git Bash', the calendar seems to overflow outside it's boundaries as well.
(Using 'Git Bash' with 'Consolas')
When trying to import using the -e flag I get the following error:
/Users/aventurella/github/project/node_modules/gitlog-parser/index.js:37
this._current.message += ('\n'+chunk);
TypeError: Cannot read property 'message' of null
at Gitlog._write (/Users/aventurella/github/project/node_modules/gitlog-parser/index.js:37:20)
at doWrite (_stream_writable.js:307:12)
at writeOrBuffer (_stream_writable.js:293:5)
at Gitlog.Writable.write (_stream_writable.js:220:11)
at LineStream.ondata (_stream_readable.js:556:20)
at emitOne (events.js:96:13)
at LineStream.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:177:18)
at LineStream.Readable.push (_stream_readable.js:135:10)
at LineStream.Transform.push (_stream_transform.js:128:32)
I'm thinking at the ~/.git-stats
file prototype which will be implemented starting with version 2.0.0
.
{
"commits": {
"<date>": ["628947f965..........ea9689ca747", "..."]
},
, "remotes": {
"[email protected]:IonicaBizau/git-stats.git": ["git-stats-hash1", "git-stats-hash2", ... ]
, "[email protected]:IonicaBizau/git-stats-importer.git": ["git-stats-importer-hash1", "git-stats-importer-hash2", ... ]
}
, "config": {
"light": true
}
}
commits
: an object with dates, being arrays with unique commit hashes.remotes
: an object with remotes, containing arrays with unique commit hashesconfig
: defaults, aliases โI'm trying to cover the feedback from the following issues:
If you have any ideas how to improve this, please leave comments here. ๐ฌ
For the 2.0.0
I want to introduce some nice graphs in browser. ๐
$ ls -lh `which node`
lrwxr-xr-x 1 wookayin admin 29B 5 4 00:02 /usr/local/bin/node -> ../Cellar/node/6.0.0/bin/node
Try to Install:
$ npm install -g git-stats
Error:
/usr/local/bin/git-stats -> /usr/local/lib/node_modules/git-stats/bin/git-stats
> [email protected] postinstall /usr/local/lib/node_modules/git-stats
> node scripts/migration/2.0.0.js
error EISDIR: illegal operation on a directory, read
/usr/local/lib/node_modules/git-stats/scripts/migration/2.0.0.js:23
data.commits = data.commits || {};
^
TypeError: Cannot read property 'commits' of undefined
at migrate (/usr/local/lib/node_modules/git-stats/scripts/migration/2.0.0.js:23:24)
at Object.<anonymous> (/usr/local/lib/node_modules/git-stats/scripts/migration/2.0.0.js:38:1)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:159:18)
at node.js:444:3
Looks migration script is broken, so tried npm install -g git-stats --ignore-scripts
either: then the git-stats
binary is installed, but another exception is thrown:
/usr/local/lib/node_modules/git-stats/lib/index.js:501
cDayObj = graph[cDay];
^
TypeError: Cannot read property 'May 4, 2015' of undefined
I am delving into this for what is the cause; this would be just a simple report as of now.
Thanks,
Hi, I've implemented an api freeCodeCamp/freeCodeCamp#11650
of FreeCodeCamp to output stats in the format of
{
stats: {
username: "fcccc4f8191",
stats: [
{
date: 1479552008474,
hash: "6dedf981ecab9ce1b3f997508dcb796f90838328"
},
{
date: 1479619115285,
hash: "051284a491a053ba29896deaf7a49f17ade241c1"
},
{
date: 1479619250135,
hash: "3aa47ee34e5bab839c88bfb411f1946e84253fea"
}
]
}
}
Is there any method to import it to git-stats? If not, would you mind me to make a pull request to implement one?
Using git-stats
and git-stats --since <date>
on the commandline always gives me a correct number for the current streak.
But git-stats --until <date>
, used with or without a --since
date always has Current Streak set to zero.
I'm using node v4.4.3 on Linux and the v2.9.5 of git-stats installed from npm.
Recently saw the EncloseJS project.
Is it possible to begin the stats as Monday ?
for the case I want this stats only for specific projects, it would be cool if I can point to a different file via an argument.
Thanks for the awesome tool :)
I wanted to use CLI activity graph for other data too, especially for my clocker statistics. Therefore I extracted the part that generates the graph and published it as a standalone: cli-cal.
Looking forward to v2.0 I would love to help separating the stats- and graph-based parts. In this way git-stats is focused on generating the stats and uses external modules to generate CLI- or browser graphs (#46). These modules can be improved as a standalone, so #14 and #28 would be solved for all kind of data.
Sorry, this is not an issue, I just want to know what theme are you using on this screenshot http://i.imgur.com/LfLJAaE.png
I recently tried git-stats and immediately got bitten with issue #2. After seeing that file I assume that is a preferences file but I cannot find any docs about it. Is it possible to set things like your preferred colours mode in this file, for instance I'd like to set the --no-ansi
option to be the default?
Would be nice to be able to export to HTML file like git-stats --export=html > stats.html
Ideally should be various exporter types, like image, html, text ansi, etc and people can add any that they like :-)
My first thought upon finding this project was that it was, of course, very cool! So I jumped into a terminal, downloaded the npm package, cd'd into the first big repo I thought of (my copy of the git repo itself) and ran git-stats. To my surprise, I saw an empty calendar. Perplexed, I jumped back to the readme to discover that git-stats keeps it's own commit history, rather than doing what I'd assumed it did, reading through the commit history of the repo the user was currently working in.
Maybe I'm misunderstanding something, but the reported current and longest streaks for git-stats -g
don't appear to be correct to me.
In each of my repositories, longest streak is the same as current streak. Neither number looks right. The issue might be on display in the image displayed in the readme---the global stats produced by git-stats --global
there don't seem to agree with the displayed calendar, and the longest streak is the same as the current streak.
After adding your sample script for catching git commit
to my .zshrc file:
$ git status
bash: -c: line 24: syntax error near unexpected token `status'
bash: -c: line 24: `} status'
So for now I'll have to live without it. Would be nice if there was an alternative, for zsh users though. :)
If you were to use watch git-stats
, which calls the same command (i.e. git-stats
) after a set interval of time, you should be able to see the stats graph update as changes are made.
Instead, there is a formatting issue that only shows you strange (unicode?) characters across your terminal. See image below:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.