Giter Club home page Giter Club logo

git-stats's Issues

Data is not displayed correctly

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:

image

~/.git-stats is attached here: git-stat.zip

cDayObj is not defined

$ 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

number of columns not calculated correctly

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?

screen shot 2015-02-18 at 08 39 11

Uninstall

I did not see an uninstall process. What would be the best way to uninstall git-stats?

Empty stats

I cloned my github repo and it shows zero stats... What am i doing wrong?
screenshot from 2015-02-16 17 27 02

Export graph to image file

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.

Doesn't launch on Ubuntu

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

Graph current repository

How does one can graph current (working directory) repository commitments? Can git-stats take this information from git log?

Reason for remote url?

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?

Windows Error: Cannot find the remote origin url. Please add it.

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?

error Error: ENOENT, open '~/.git-stats'

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

With fewer columns, the left side of the calendar should be hidden, not the right

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.

screen shot 2015-02-18 at 10 53 47 am

Installation instructions do not work

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.

Export option

I was thinking it would be nice to have an data export option so that it could be used on a website.

Usage not immediately clear

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?

ReferenceError: lines is not defined

$ 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)

ignore commits with identical hash

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)

Calendar doesn't seem to work correctly on Windows.

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.
raster-font
(Using CMD with 'Raster Font')

Using 'Git Bash', the calendar seems to overflow outside it's boundaries as well.
consolas
(Using 'Git Bash' with 'Consolas')

TypeError: Cannot read property 'message' of null

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)

New schema prototype (2.x.x)

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 hashes
  • config: 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. ๐Ÿ’ฌ

Browser graph

For the 2.0.0 I want to introduce some nice graphs in browser. ๐ŸŒŸ

Installation Error: Cannot read property 'commits' of undefined

  • OS X (Homebrew)
  • Node version : 6.0.0 (installed with homebrew, and the same happens for node 4.x, 5.x that I've tested)
$ 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,

Is there any method to git-stats --record some records from an JSON api?

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?

Bad month labels positionning

Current month labels positionning in the output is somewhat random and does not always appear nicely above the corresponding week columns.

git-stats-importer

It would be neat to position the month labels right above the first week of the month.

I wrote a patch for this and I'm gonna post a pull request asap.

Current Streak is Always Zero when --until Date Is Supplied

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.

Extract graph generation

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.

Display problem in tmux

Here's the screenshot from my gnome-terminal. It works like a charm.

git-status-terminal

But there's some problems when I execute git-status in tmux.

git-status-tmux

Set defaults in ~/.git-stats

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?

Export to HTML

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 :-)

Is there a particular reason git-stats keeps it's own record of git activity?

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.

streak statistics in global view appear to be off

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.

Catching git-commit from zsh

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. :)

Formatting breaks when using `watch`

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:
screenshot from 2015-02-16 12 27 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.