Coder Social home page Coder Social logo

git-cal's Introduction

git-cal

Description

screenshot with black theme screenshot with white theme on your terminal

  • git-cal is a simple script to view commits calendar (similar to github contributions calendar) on command line
  • Each block in the graph corresponds to a day and is shaded with one of the 5 possible colors, each representing relative number of commits on that day.
  • Option to choose --ascii or --unicode to denote the same instead of the ANSI colors.
  • Option to use git config to set options.

Install

  • with root access:
perl Makefile.PL
make
sudo make install
  • without root access:
perl Makefile.PL PREFIX=~/.local
make
make install
  • with Homebrew
brew install git-cal

git-cal's People

Contributors

diminutivesloop avatar fs111 avatar hradecek avatar igamid avatar janhancic avatar k4rthik avatar kentatogashi avatar kiwiroy avatar mattmartini avatar mhor avatar mig0 avatar mwolfetech avatar nferraz avatar offbyone avatar ozcan avatar sicaine avatar streeter avatar zitrax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-cal's Issues

Feature Request: Activity for Previous Years

Hi,

Great project!

I'd like to see activity of previous years of a project.

Maybe you could just extend --period to allows numbers greater that -11 so that if I were to input -36 for example it would show three graphs in order of the years with the year number above.

Thanks

Argument to filter by author

Same as git log's:

 --author=<pattern>, --committer=<pattern>
     Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression). With
     more than one --author=<pattern>, commits whose author matches any of the given patterns are chosen.

Show only as large a time period as the terminal has room for

Right now my 80 column terminal displays reasonable output for --period -7, but for anything longer than that (eg. the default period) it overflows and wraps. Assuming there are no issues with half-width vs. full-width characters that depend entirely on user fonts, the program should be able to detect the terminal width (using tput cols) and limit the default output accordingly.

Modify --period for negative numbers

git-cal --period=-1 should return the current month, in the same way as $array[-1] returns the last element of an array (and not the last two).

This way, --period=-2 would return 2 months, -3 would return 3 months, and so on, up to --period=-12, which would return 12 months.

Alternative color palettes

I changed the default colors to: my @colors = ( 237, 7, 3, 2, 10 ); to achieve a more yellow-to-green palette, just like Github.

It would be nice to have the option to use a palette like that out of the box, maybe with a command line argument that users can "alias" to:

.bashrc:
alias "gitcal" "git-cal --green-palette"

Add some statistics too

The most important part of the GitHub calendar is the part which tells you your current streak.

What do you guys think about adding it to git-cal?

If doesn't sound totally crazy I'd like to try to add it there. It should be easy given the fact that there already is a compute_stats function which computes these stats.

Remove background-colour

This doesn't work so well on non-black backgrounds:

screen shot 2014-09-24 at 4 11 57 am
screen shot 2014-09-24 at 4 12 20 am

It'd be ideal if the background-colour of the cells weren't set, by default; perhaps it could be set behind a flag, for people whose (perhaps transparent, or similar) terminals necessitate that?

Could you create a release tag?

I'm writing a homebrew formula to make it easier to install this for bew users and the policy there is to only install using tarballs generated in the upstream repo, not by pulling tip of master.

Thanks!

[FEATURE] Allow git-cal to receive STDIN json input

This should not be difficult to implement but allow various possibilities.

External input could be pulled from internet data or summarized from local repos. The json format should be an array of [date, int].

Can't seem to install!

I'm using Ubuntu 12.04 and tried following your installation method where I stumbled upon an error at the second command:

First command:
screenshot from 2013-09-24 01 09 53

Second command:
screenshot from 2013-09-24 01 10 41

Is there something wrong? Or I missed out something?

Author argument doesn't appear to work.

jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author=Jesse\ Donat                                                                                                  1↵ 17:24:32
fatal: ambiguous argument 'Donat': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author="Jesse Donat"                                                                                                 2↵ 17:24:47
fatal: ambiguous argument 'Donat': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author="Jesse Donat" -- .                                                                                            2↵ 17:24:56
fatal: bad revision 'Donat'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author=Jesse Donat -- .                                                                                              2↵ 17:25:14
fatal: Donat do not exists
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author=Jesse\ Donat -- .                                                                                             2↵ 17:25:24
fatal: bad revision 'Donat'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ »                                                                                                                                

showing git-cal output for all your git repositories

If you can configure the git log command used, you could use mr to get the git-cal output for a group of repositories: ranging from all the repositories tied to a particular project or every repository you've ever written!

Something like: git cal --git-command="mr -c ~/.mrconfig-projectXYZ" which would call mr -c ~/.mrconfig-projectXYZ log [... rest of args ...]

Bad detection of $TERM

I had to use this hack to use git-cal:

diff --git a/git-cal b/git-cal
index 48e827b..29fb58a 100755
--- a/git-cal
+++ b/git-cal
@@ -42,8 +42,8 @@ sub process {
     my $colors_supported = qx/tput colors/;
     if ($colors_supported && $colors_supported < 256) {
       chomp $colors_supported;
-      print "fatal: 'tput colors' returned < 256 (" . $colors_supported . ") , cannot plot the calendar as the terminal doesn't support enough colors
-      exit(1);
+      # print "fatal: 'tput colors' returned < 256 (" . $colors_supported . ") , cannot plot the calendar as the terminal doesn't support enough colo
+      # exit(1);
     }
     init_cal_stuff();
     my $extra_args = "";

As you can see on mys screenshot, everything is ok
screenshot

Basic mercurial support

In order to add a basic mercurial support I managed to get this log command:

On line 54 use this command: hg log --template "{date|hgdate}\n" | cut -d' ' -f1

is pretty lame I know, there's no need for cut and needs some revset for the "since 13 months" part, but is a start, anyone willing to help?

git-cal failed on locating JSON/PP.pm - OS X 10.8.5

After updating the binary of git-cal to latest commit, it no loger work.

Can't locate JSON/PP.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /usr/local/bin/git-cal line 11.
BEGIN failed--compilation aborted at /usr/local/bin/git-cal line 11.

I'm not a Perl programmer so don't know where to go then. Please help. Thank you!

Show daily hours of activity over week

Currently, what's plotted is weekday vs. months within a year.
Feature request: provide an option to plot weekday vs. hours within a week (averaging all weeks), in the commit's Time Zone (so 12:00 is noon and 23:59 is almost midnight for the developer submitting the commit).

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.