As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label vcsstat.sh. Show all posts

gitfiti, an interesting idea to paint graffiti on GitHubs commit history calendar, though it probably doesnt have much practical value beside becacuse its fun and I can do it!

Anyway, I wasnt going to write about it because I didnt want to create repositories just for fun. But I remembered my vcsstat.sh project, and if you combine both, you can have:

https://lh5.googleusercontent.com/-LBxEscGbTKM/UZuNioCbXSI/AAAAAAAAE0I/6vumCkRuOv4/s800/gitfiti%2520and%2520vcsstat.sh%25202013-05-21--23%253A00%253A22.png

The creation of gitfiti wasnt quite clear when I started. There were five repositories in the screenshot. I used five because its easier if I messed up with week offset, I could just delete a repository and recreate with correct week offset. Anyway, with vcsstat.sh, two extra modes.

There seemed to be some calculation issue with vcsstat.sh, some days colors are off, but Im not up to fix it.

One and a half years ago, I released first version of vcsstat.sh and I regularly use it to check my commit statistics. A few days ago, I stared to modify vcsstat.sh, then hours ago, I had an idea, inspired by GitHubs Contributions calendar, which they added last month with some other features as new contribution tab in GitHub profile page.

Now, I have similar calendar right in terminal, just the way I like it.

The following screenshot was take from output of new version 0.2. The box-drawing Unicode characters and colors render the different amount of commits. The calendar is just like the one on GitHub, but always starting from ISO week 1 at the leftmost column. The rows are starting from Monday to Sunday, 7 rows for each year.

https://lh6.googleusercontent.com/-pmy5cph0Zw8/UQ6UIjEduyI/AAAAAAAAEaQ/hKDTOZWAuj8/s800/vcsstat.sh%2520-%2520commit%2520calendar.png

Commit calendar

The calendar prints out full years, from year of first commit to year of last commit. You can see there is a header line of abbreviation of months, with the year number replacing the position of January.

The corresponding list of changes, additions and deletion, is shown below.

https://lh4.googleusercontent.com/-2xZlGFL7Rls/UQ6UJvC3gqI/AAAAAAAAEaY/RCDjyt5tySY/s800/vcsstat.sh.png

This is basically what vcsstat.sh did before, I only added a total number for this output, although I did edit the code for little better performance.

The calendar uses Unicode and ANSI colors to render, some may not like them or environment may not be able to support, so I also added some options to turn them off. Next screenshot shows output without colors:

https://lh6.googleusercontent.com/-F5Mz3mkaJMk/UQ6UHb827EI/AAAAAAAAEaI/d10VfQSft-I/s800/vcsstat.sh%2520-%2520commit%2520calendar%2520-%2520no%2520color.png

Disable color output

The final one is non-Unicode output:

https://lh6.googleusercontent.com/-jlG8EZDWXok/UQ6UGUB2hnI/AAAAAAAAEaA/xAyiYmPZFQA/s800/vcsstat.sh%2520-%2520commit%2520calendar%2520-%2520no%2520Unicode.png

Disable Unicode output

There may be some confusing between different outputs, but the calendar isId sayjust for a feeling, dont look into it too seriously. If you would like to try it, go to vcsstat.sh project. Its just a Bash script and it can scan current (sub-)directory of Git or Mercurial repositories.

Note

a new blog post and new version of this script have been published, it adds new option for Commit calendar like Contributions calendar in a GitHub profile page. (2013-02-03T17:30:40Z)

Here is the quick stuff to understand what this is:

$ vcsstat.sh -h

vcsstat.sh [''|AUTHOR_NAME [''|HG_DATESPEC [''|GIT_SINCE [''|GIT_UNTIL]]]]

Every argument is basically optional, however you need to use '' to indicate
that you are not specifying it.

HG_DATESPEC Examples
====================

  "2011-08"
  "2011-01 to 2011-03" # Jan. to Mar. in 2011
  ">2011-05"           # Since May.
  "-3"                 # Last three days

See hg manpage for DATE FORMATS section.

GIT_SINCE and GIT_UNTIL Examples
================================

  "2011-01-23"
  "yesterday"
  "2 weeks ago"

See..., uhm I have no idea where to look at. gitrevisions manpage for
date specification, perhaps?

You can grab the script here.

The script will list all directories and look for VCSes special hidden directory. Currently (and probably only will be), it only supports Git and Mercurial (Hg). As you can see, there are two types datespec used. Git and Hg have some differences, I need to separate into two.

Its MITd and hosted on GitHub, feel free to request features or even better, open pull requests! (Patch might be more suitable, or you need to publicly fork my dotfiles on GitHub).

I wrote this because I believed I had caffeine overdose (xD), but clearly, from the screenshot above, I didnt have.

Gotta have my cup, gotta have caffeine!

Shoot! Its already Saturday.

(I know, I know its old but still have too much caffeine in my brain, thats all I can come up with. ;)

Edit: Damn forgot this blogs timezone is set to Pacific time Its still FRIDAY, YEAH!

*** WARNING: This blog owner is BUI (Blogging Under Influence)! ***