Giter VIP home page Giter VIP logo

git-loc's Introduction

Simple tool to display LOC (lines of code) count history for a git branch.


Example:

2010-05-13 14:38:21       42   +44    -2     initial
2010-05-13 14:40:14       44    +3    -1     hashbang added
2010-05-13 14:40:14       49    +8    -3     show last commit too


Run it as `git-loc --svg' to output svg graph on stdout.
It is possible to specify the .git folder you wish to the repository you wish to get stats about.
`git-loc --svg ../another-repo'

git-loc's People

Contributors

azizshamim avatar cdinger avatar itikhonov avatar jameswhite avatar jimenezrick avatar poulter7 avatar temporaer avatar ticpu avatar yoni 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

git-loc's Issues

'utf8' codec can't decode byte 0xf6 in position 1731: invalid start byte

In this repository https://github.com/jimenezrick/vimerl the next error happens with Python 3.2.2:

Traceback (most recent call last): File "/usr/local/bin/git-loc", line 25, in <module> for x in popen('git log --reverse -p'): File "/usr/lib/python3.2/codecs.py", line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 1731: invalid start byte

hsh is not defined

$ ./git-loc --svg ~/Sites/h5bp/html5please/
Traceback (most recent call last):
  File "./git-loc", line 68, in <module>
    pop()
  File "./git-loc", line 33, in pop
    pstr="%s %8u %5s %5s %7s %s \t%s"%(d,locs,'+'+str(adds),'-'+str(dels),hsh,who,cmt.strip())
NameError: global name 'hsh' is not defined

Title ToolTip Not Shown

I found that when I embed the image in a web page, the tooltip title is not shown. If I change the title attribute to a child node, it does get rendered correctly.

It requires the following changes:

  • modifying the rect function arguments (adding t for title)
  • putting a title child node rather than attribute
  • in bl.append, the class=o was previously appended to the title, making it an attribute in the SVG next to title=
    def rect(x,y,w,h,c,t='',a=''):
        svg.write("""<rect x="%u" y="%u" width="%u" height="%u" style="%s" %s ><title>%s</title></rect>""" %(x,y,w,h,c,a,t))



    bl.append((x-12,0,25,mlocs*yscale,'', """%s %8u %5s %5s   %s """%(d,locs,'+'+str(adds),'-'+str(dels),quote(cmt.strip())) ,"""class="o" """))

This fixes my only issue with the script. Not sure why, but embedded as an iframe or an object, I did not get tool tips with title as attribute.

Thanks

Problems with encoding in git output

I just tried to run this on a repo and it aborted with the following error:

Traceback (most recent call last):
  File "c:/Users/Marcus/Desktop/git-loc.py", line 42, in <module>
    for x in popen('git log --no-color --reverse -p'):
  File "c:\Python33\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 1162: cha
racter maps to <undefined>

I unfortunately don't know my way around Python but I found this ticket which has been marked as "WontFix". But probably there's some way around it?

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.