News for hackers. Stuff that matters.
Re:Git-Stats – A local GitHub-like contributions calendar by peterjmag on Monday February 16, 2015 @08:12AM (#9056727)
Cool! I was actually just looking for a tool like this a couple of weeks ago. I stumbled across git-cal[1], which only works on one repository at a time, but it doesn't require you to import your commits first like this one does[2].

Here's my output from both tools, generated from the repo I spend most of my time in at work: http://i.imgur.com/chrmeP6.png.

[1] https://github.com/k4rthik/git-cal

[2] https://github.com/IonicaBizau/git-stats#importing-and-delet...

EDIT: Just noticed that the "contributions" counts differ.

    peterjmag@peters-imac ~/checkouts/rg/community (git::master) 
    $ git rev-list HEAD --author="Peter" --since="1 year ago" --count
    1205
But git-stats shows 1292. What does it count as a contribution?
Re:Git-Stats – A local GitHub-like contributions calendar by Amorymeltzer on Monday February 16, 2015 @10:10AM (#9057175)
Does one exclude merge commits while the other includes them?
Re:Git-Stats – A local GitHub-like contributions calendar by k4rthik on Monday February 16, 2015 @12:23PM (#9057943)
Yes, git-cal excludes merge commits.
Re:Git-Stats – A local GitHub-like contributions calendar by Cthulhu_ on Monday February 16, 2015 @09:31AM (#9057024)
Name might be a bit confusing with the Gitstats project (http://gitstats.sourceforge.net/)
Re:Git-Stats – A local GitHub-like contributions calendar by omouse on Monday February 16, 2015 @05:16PM (#9059394)
They should connect and then integrate the calendar into gitstats, it looks really useful and would be awesome to put into the gitstats report.
Re:Git-Stats – A local GitHub-like contributions calendar by colomon on Monday February 16, 2015 @08:04AM (#9056706)
I'm only half-awake, so maybe I'm missing something obvious. Why is the README talking about a git commit hook? Why not just take the data from the log?
Re:Git-Stats – A local GitHub-like contributions calendar by michaelmior on Monday February 16, 2015 @08:11AM (#9056724)
It seems like for performance reasons, git-stats wants to update the calendar on commit instead of generating it on the fly. git-cal[0] just does this on the fly and works reasonably fast for me. The UI looks very comparable.

[0] https://github.com/k4rthik/git-cal

Re:Git-Stats – A local GitHub-like contributions calendar by colomon on Monday February 16, 2015 @09:14AM (#9056958)
Hmm, just installed git-cal and it certainly is adequately fast on my main work repo. But it seems to just be for the current branch? (That seems sensible enough, but also makes it somewhat less useful.)
Re:Git-Stats – A local GitHub-like contributions calendar by k4rthik on Monday February 16, 2015 @12:24PM (#9057952)
Added an option to view stats from all branches ( git-cal --all ), but that'll be slower for large repositories
Re:Git-Stats – A local GitHub-like contributions calendar by colomon on Monday February 16, 2015 @01:51PM (#9058463)
Brill, it's still quite fast on my work repo, and much more useful to me. :)
Re:Git-Stats – A local GitHub-like contributions calendar by drtse4 on Monday February 16, 2015 @08:17AM (#9056743)
Looks like that he parses the log with the hook and then stores the json output in ~/.git-stats (git-stats --record), my guess is that he then generates the calendar only from that data so that he doesn't have to parse the whole history all over again. I'm a bit worried about the size of that file though...
Re:Git-Stats – A local GitHub-like contributions calendar by rplnt on Monday February 16, 2015 @09:30AM (#9057016)
If you were fully awake you'd notice it also talks about executing a remote file that you have no control over on every git commit you run.
Re:Git-Stats – A local GitHub-like contributions calendar by arxpoetica on Monday February 16, 2015 @09:31AM (#9057021)
Funny. I was annoyed it was all private so I made mine public 11 days ago. Nice coincidence. https://github.com/arxpoetica/commits
Re:Git-Stats – A local GitHub-like contributions calendar by qznc on Monday February 16, 2015 @08:50AM (#9056875)
Why do people care about this? I never understood why Github features things like "longest commit streak" so prominently.
Re:Git-Stats – A local GitHub-like contributions calendar by kaolinite on Monday February 16, 2015 @09:08AM (#9056934)
I like the commit streak statistic because, when I attempt to maintain a long streak, I get into the habit of committing something - even something small - once a day. Once I've made even the slightest change, I'm more likely to keep working. I find that it's a good motivator.
Re:Git-Stats – A local GitHub-like contributions calendar by danadam on Monday February 16, 2015 @09:29AM (#9057007)
Re:Git-Stats – A local GitHub-like contributions calendar by gknoy on Monday February 16, 2015 @01:36PM (#9058376)
I would love it if, for things like my work repo, I could count "Don't break the chain of weekday commits" -- I would prefer not to be penalized for not working on the weekend. :)
Re:Git-Stats – A local GitHub-like contributions calendar by erikano on Monday February 16, 2015 @12:42PM (#9058043)
I love the don't break the chain thing but just wanted to point out that Jerry Seinfeld said in an AMA on Reddit that he did not invent that program http://www.reddit.com/r/IAmA/comments/1ujvrg/jerry_seinfeld_...
Re:Git-Stats – A local GitHub-like contributions calendar by vhost- on Monday February 16, 2015 @02:27PM (#9058684)
It's totally superficial, but I find it fun. It's something to check once in a while and be like "hey, I have a dark green box. I wonder how many times I committed that day."

When I left my previous job, they revoked my Github access and I lost 3k commits on the calendar and it was a bummer. I wasn't throwing a fit or anything. I just had to start over :).

Re:Git-Stats – A local GitHub-like contributions calendar by pedrosanta on Monday February 16, 2015 @06:34PM (#9059749)
Cool, I always enjoy clever git visualisation tools. While you are immersed in code it's hard to get a good grasp on what are your routines, or on what you've accomplished, and these tools give you a nice picture of that - and I've found them rather useful on retrospective or post-mortem moments.

One of the tools I use now an then is gource:

https://code.google.com/p/gource

It puts you entire log on a neat graph like file structure with the contributors firing out changes to nodes as time goes by.

Re:Git-Stats – A local GitHub-like contributions calendar by josteink on Monday February 16, 2015 @09:02AM (#9056917)
Doesn't work for me on Windows. Keep getting a blank calendar: That is it has dates and all but no commits.
Re:Git-Stats – A local GitHub-like contributions calendar by jayrhynas on Monday February 16, 2015 @10:00AM (#9057130)
Re:Git-Stats – A local GitHub-like contributions calendar by klapinat0r on Monday February 16, 2015 @12:00PM (#9057793)
Still doesn't work (for me, osx)

  user@host ~/tmp # npm install -g git-stats
  /usr/local/bin/git-stats -> /usr/local/lib/node_modules/git-stats/bin/git-stats
  [email protected] /usr/local/lib/node_modules/git-stats                                                                                                                                                       ├── [email protected]
  ├── [email protected]                                                                                                                                                                                       ├── [email protected] ([email protected])
  ├── [email protected]                                                                                                                                                                                            ├── [email protected] ([email protected])
  └── [email protected] ([email protected])                                                                                                                                                                       user@host ~/tmp # npm install -g git-stats-importer                                                                                                                                                         /usr/local/bin/git-stats-importer -> /usr/local/lib/node_modules/git-stats-importer/bin/git-stats-importer
  [email protected] /usr/local/lib/node_modules/git-stats-importer                                                                                                                                     ├── [email protected]
  ├── [email protected]                                                                                                                                                                                             ├── [email protected] ([email protected])
  ├── [email protected] ([email protected])                                                                                                                                                                       └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
  user@host ~/tmp # git clone https://github.com/IonicaBizau/git-stats
  Cloning into 'git-stats'...                                                                                                                                                                                 remote: Counting objects: 414, done.
  remote: Total 414 (delta 0), reused 0 (delta 0)                                                                                                                                                             Receiving objects: 100% (414/414), 47.08 KiB | 0 bytes/s, done.
  Resolving deltas: 100% (189/189), done.                                                                                                                                                                     Checking connectivity... done.
  user@host ~/tmp : cd git-stats
  user@host ~/tmp/git-stats # git-stats-importer
  info  Done.
  user@host ~/tmp/git-stats # git stats
  ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
  ║   Mar      Apr      May      Jun      Jul      Aug      Sep      Oct      Nov      Dec      Jan      Feb       ║
  ║Sun   ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ║
  ║Mon   ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ║
  ║Tue   ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■   ║
  ║Wed   ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■   ║
  ║Thu   ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■   ║
  ║Fri   ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■   ║
  ║Sat   ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■   ║
  ║--------------------------------------------------------------------------------------------------------------  ║
  ║Contributions in the last year: 0 | Longest Streak: 0 days | Current Streak: 0 days | Max a day: 0              ║
  ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
  user@host ~/tmp/git-stats # cat $HOME/.git-stats
  {}
Re:Git-Stats – A local GitHub-like contributions calendar by jayrhynas on Monday February 16, 2015 @12:47PM (#9058080)
git-stats-importer also only imports commits by the user set in the global user.email config. Since you haven't made any commits to the git-stats repo, it doesn't show anything.

Edit: it will use the local user.email if that is set. It also will use the GIT_AUTHOR_EMAIL but only as a fallback if user.email is unset

Re:Git-Stats – A local GitHub-like contributions calendar by klapinat0r on Monday February 16, 2015 @12:58PM (#9058142)
Ah, I see. A bit annoying when using more than one user.email across projects. But git-cal works okay :)

Thanks for the info.

Re:Git-Stats – A local GitHub-like contributions calendar by KhalPanda on Monday February 16, 2015 @09:12AM (#9056953)
I'm getting the same on Ubuntu.
Re:Git-Stats – A local GitHub-like contributions calendar by aendruk on Monday February 16, 2015 @03:56PM (#9058956)
There's an R package for producing nice images like this. Example of visualizing Git contributions: https://andrew.kvalhe.im/easy-calendar-heatmaps-for-git/
Re:Git-Stats – A local GitHub-like contributions calendar by euphemize on Monday February 16, 2015 @09:13AM (#9056957)
Awesome stuff, I really like this for the following reason:

While I do push data to github for various projects, I actually take part in 3-4 active, self-hosted redmine projects that would never be counted in the github graph. Same for a seldom-updated bitbucket project.

Re:Git-Stats – A local GitHub-like contributions calendar by halosghost on Monday February 16, 2015 @09:40AM (#9057063)
I wish only that it weren't node…
Re:Git-Stats – A local GitHub-like contributions calendar by halosghost on Monday February 16, 2015 @10:32AM (#9057284)
I find it funny that I was down-voted so for this. I haven't maligned the project at all; in fact, I think it's incredibly cool, I'm just not a huge fan of node.
Re:Git-Stats – A local GitHub-like contributions calendar by tokenizerrr on Monday February 16, 2015 @11:23AM (#9057558)
I downvoted you because negative nonconstructive comments may as well not be posted. They provide no tangible benefit to anyone who participates in the discussion.

If you have a compelling reason as to why this project would be better done in another language then it would be prudent to include this reason in your original post. If all you're going off is personal preference then it may be best to keep this to yourself.

Re:Git-Stats – A local GitHub-like contributions calendar by halosghost on Monday February 16, 2015 @12:52PM (#9058110)
I understand your hope for comments to be constructive, and if you would like to have a discussion about the negatives of Node, it seems like that might be better on an article actually discussing that (though I will include them in this post to sate your curiosity :P). Additionally, I did not wish to start a flamewar (which always happens when you get into a discussion about the relative merits of a language on the internet).

My reservations about Node stem from this kind of app actually; the creation of a tool that goes far beyond the realistic and sensible use-case for Node.

That is, the huge benefit that Node offers is the ability to have both server- and client-side scripting in the same language; that's awesome. However, it's a fairly common bit of knowledge that JS is less than ideal for a wide variety of reasons (e.g., no integers, breaking the commutative property, etc.). While it may be a great alternative to PHP, it's still not that great of a language. So, to go beyond the notion of just using it to unify the language for webapps and to start creating userland applications on such a platform seems very counterproductive to me.

In this case, I am especially taken by the fact that this author has made three or four projects which all do similar things but for different use-cases. If this project were made into, for example, a C library, all of the derivative projects could just source that library and be simpler for it. Not to mention the fact that other projects could interface with it as well.

Despite C's reputation as being rather hard to make portable code, a public API with a C library actually makes it incredibly portable and extensible.

Again, I am completely okay with Node (I don't crusade against its existence), it just saddens me to see such cool projects be based on such a platform when there are obvious benefits to using something closer to the metal.

Re:Git-Stats – A local GitHub-like contributions calendar by spidermanto on Monday February 16, 2015 @09:33AM (#9057032)
Good article, I like it.
Re:Git-Stats – A local GitHub-like contributions calendar by cubitesystems on Monday February 16, 2015 @09:27AM (#9057003)
That's not what I need.

I need download stats, checkout stats, per page view stats and per file view stats.

Re:Git-Stats – A local GitHub-like contributions calendar by olalonde on Monday February 16, 2015 @09:41AM (#9057064)
This tool is designed to work with Git, not Github. The stats you are referring to would need to be made available by Github.
Re:Git-Stats – A local GitHub-like contributions calendar by halosghost on Monday February 16, 2015 @01:10PM (#9058199)
Actually, if you look at the project more closely, it does support github. In fact, there's even a derivative project that directly interacts with github. However, I think the point of this poster's comment was that this project's scope doens't include ey's needs, not that it doesn't interface with a particular service (I, of course, could be wrong in that interpretation).