threads / discuss / 17603

Count the line of codes

Subject: Count the line of codes

## tl;dr

4 messages between Feb 6, 2009 and Feb 6, 2009.

replies: 3people: 4as markdown or json

zyk· Feb 6, 2009, 07:55 UTC · lore

Does anyone know if there is any tools available for counting the line of codes in the project using GIT?

How to count the code changes on the specific branch? How to count the delta lines between one tag and its successive tag?

-- 
View this message in context: http://www.nabble.com/Count-the-line-of-codes-tp21868069p21868069.html
Sent from the git mailing list archive at Nabble.com.
Johannes Gilger· Feb 6, 2009, 08:23 UTC · re: zyk · lore

Re: Count the line of codes

On 2009-02-06, zyk <zhengyuk@hotmail.com> wrote:
>
> Does anyone know if there is any tools available for counting the line of
> codes in the project using GIT?

wc -l *.c *.h for example would count the lines of all c-files and their headers.

> How to count the code changes on the specific branch?
> How to count the delta lines between one tag and its successive tag?
git diff tag~..tag --stat

Greetings, Jojo

-- 
Johannes Gilger <heipei@hackvalue.de>
http://hackvalue.de/heipei/
GPG-Key: 0x42F6DE81
GPG-Fingerprint: BB49 F967 775E BB52 3A81  882C 58EE B178 42F6 DE81
Matthieu Moy· Feb 6, 2009, 12:50 UTC · re: Johannes Gilger · lore

Re: Count the line of codes

Johannes Gilger <heipei@hackvalue.de> writes:
Show 7 quoted lines
> On 2009-02-06, zyk <zhengyuk@hotmail.com> wrote:
>>
>> Does anyone know if there is any tools available for counting the line of
>> codes in the project using GIT?
>
> wc -l *.c *.h for example would count the lines of all c-files and 
> their headers.

wc for the total number of lines in files, or http://www.dwheeler.com/sloccount/ to get the number of lines of code (excluding blank lines and such).

-- 
Matthieu
Jakub Narebski· Feb 6, 2009, 14:08 UTC · re: Matthieu Moy · lore

Re: Count the line of codes

Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 12 quoted lines
> Johannes Gilger <heipei@hackvalue.de> writes: 
>> On 2009-02-06, zyk <zhengyuk@hotmail.com> wrote:
>>>
>>> Does anyone know if there is any tools available for counting the line of
>>> codes in the project using GIT?
>>
>> wc -l *.c *.h for example would count the lines of all c-files and 
>> their headers.
> 
> wc for the total number of lines in files, or
> http://www.dwheeler.com/sloccount/ to get the number of lines of code
> (excluding blank lines and such).
Or Ohcount (OSS part of Ohloh) from http://labs.ohloh.net/ohcount

Or GitStat (but that is web-based) which you can see at work at http://mirror.celinuxforum.org/gitstat/

Or git-statistic GSoC 2008 project http://repo.or.cz/w/git-stats.git
HTH
-- 
Jakub Narebski
Poland
ShadeHawk on #git

← back to recent threads