News for hackers. Stuff that matters.
Re:Git-cal - GitHub Activity Calendar for your Terminal by binarymax on Monday September 23, 2013 @12:41PM (#6432149)
Awesome! Running $tput colors will tell you if you have 256 or not (mine shows 8). I am on ubuntu and found a tutorial to upgrade - will give it a try just so I can run this.

Slightly off-topic, I had some fun with tput about a month ago here: http://max.io/bash.html ...but it only supports 8 colors. Maybe I can upgrade with this new knowledge. Thank you!

Re:Git-cal - GitHub Activity Calendar for your Terminal by LeonidasXIV on Monday September 23, 2013 @07:37PM (#6434877)
I just did "export TERM=xterm-256color" in my gnome-terminal 3.8.4 which made "tput colors" return 256 and the script worked.
Re:Git-cal - GitHub Activity Calendar for your Terminal by cocoflunchy on Monday September 23, 2013 @04:00PM (#6433750)
Awesome! Thanks for sharing, I'm going to have fun pimping my scripts now.
Re:Git-cal - GitHub Activity Calendar for your Terminal by sharyanto on Wednesday September 25, 2013 @02:11AM (#6442928)
tput doesn't seem to recognize Konsole's 24bit color support though.
Re:Git-cal - GitHub Activity Calendar for your Terminal by contingencies on Monday September 23, 2013 @10:05PM (#6435436)
Cute project. The fundamental problem remaining is that proper participation on Github seems to still require a web browser.

If you could figure out how to get the rest of its functionality working well on the command line (discussions, etc.) without resorting to unnavigable links sessions, then it'd be a still funkier achievement.

I'm surprised they haven't done this themselves, to be honest.

Re:Git-cal - GitHub Activity Calendar for your Terminal by sharyanto on Wednesday September 25, 2013 @02:23AM (#6442972)
The script works on any git repo. It's just that the graphs being produced are similar to those found on Github. Aside from that, the script is not related to Github at all.
Re:Git-cal - GitHub Activity Calendar for your Terminal by k4rthik on Wednesday September 25, 2013 @07:06AM (#6443763)
Yes, the title is slightly misleading and different from the project title "github like contributions calendar on terminal". Adding github support (just to view the same graph on terminal rather than firing the web page for it) is one of the suggestions and is in TODO list.
Re:Git-cal - GitHub Activity Calendar for your Terminal by k4rthik on Wednesday September 25, 2013 @07:06PM (#6447909)
It is now. Added --github | gh option to pull public contributions data from github
Re:Git-cal - GitHub Activity Calendar for your Terminal by breckinloggins on Monday September 23, 2013 @12:32PM (#6432087)
Looks great!

> assumes the terminal is 256 colors

Would there be a way to degrade gracefully somehow if not? Perhaps using grayscale?

Re:Git-cal - GitHub Activity Calendar for your Terminal by k4rthik on Monday September 23, 2013 @01:49PM (#6432766)
Thank you. https://github.com/k4rthik/git-cal/commit/2c6b50b57fa818d943... should solve it partially (exit(1) if tput colors < 256)
Re:Git-cal - GitHub Activity Calendar for your Terminal by solox3 on Monday September 23, 2013 @02:10PM (#6432970)
Weird, because before this check was introduced this morning, Konsole reported 8 colours, but rendered your git-cal correctly, using more than 8.
Re:Git-cal - GitHub Activity Calendar for your Terminal by __david__ on Monday September 23, 2013 @07:45PM (#6434909)
Konsole may support more than 8 colors but if your TERM environment is set wrong then the OS won't know it can. If you bypass the OS and print the color escape sequences directly (as the script is doing, naughtily[1]) then it might just work.

[1] The proper way is to use terminfo to output the escape sequences for you. See http://perldoc.perl.org/Term/Cap.html for how to do this with standard Perl. EDIT: I can't get this to work—Seems Perl has poor terminfo support. :-( "tput setaf 10" is the correct way from sh.

Re:Git-cal - GitHub Activity Calendar for your Terminal by k4rthik on Wednesday September 25, 2013 @07:07AM (#6443769)
Yes, this change was reverted. + Now there is --ascii option to view the graph with some ascii characters instead of ANSI colors
Re:Git-cal - GitHub Activity Calendar for your Terminal by LeonidasXIV on Monday September 23, 2013 @07:38PM (#6434881)
Yes, apparently it does the same thing as gnome-terminal, which does not advertise its support for 256 colors.
Re:Git-cal - GitHub Activity Calendar for your Terminal by sharyanto on Wednesday September 25, 2013 @02:20AM (#6442958)
I would recommend my small library Color::ANSI::Util (https://metacpan.org/module/Color::ANSI::Util ) which has ansifg($rgb) and ansibg($rgb) function. They can detect terminal's color depth and output either 24-bit/256-color/16-color ANSI color escape codes.

But I guess the author wants to avoid using non-core dependencies.

Cool script, anyhow! I spent a lot of times looking at this kind of activity graph on Github.

As already submitted to the Github issues, the ability to show activity of multiple git repos as a single graph would be neat, as we tend work across multiple git repos.

Re:Git-cal - GitHub Activity Calendar for your Terminal by chankey_pathak on Wednesday September 25, 2013 @12:24AM (#6442620)
Awesome! +1 for using Perl :)
Re:Git-cal - GitHub Activity Calendar for your Terminal by jpinkerton88 on Monday September 23, 2013 @12:33PM (#6432103)
i love this