Git Product home page Git Product logo

git-repo-stats's Introduction

git-repo-stats

This is a script that can be used to exactly identify the no of lines that have been added, deleted and modified in a git repository from a specific period of time in the past to the current state of the repository and to obtain percentages of them to the total no of lines in the repository. Since this script is not using any third party programs (cloc and etc) this script is highly durable.

Installation Prerequisites

Prior to using this program you need to have installed git in your system. You can follow this link to install git relevant to your system.

Since this script use awk commands your system must be able to run awk languages. If your are using a Linux based system they already comes with mawk pre installed so you don’t need to install it again, but if your are using Windows platform follow this link to install awk in your Windows platform.

Running the program

To use this script, first you need to clone the repository that you wish to get statistics if you don't have it in a local drive. Once after cloning is done you can run this script with the giving absolute location of the cloned repository and the relevant time period that you wish to get statistics as command line arguments.

For example lets say I have a cloned repository in my /home/kasun/workspace/clonedRepo location and I need to get the statistics about the no of lines added, deleted and modified from 6 months ago. Then I need to run the script in the terminal by giving the relevant arguments as follows,

./getStats.sh /home/kasun/workspace/clonedRepo 6 months ago

then the output will be as follows :-

no of lines changed 6118

no of lines added 141893

no of lines deleted 112403

total no of lines in the repo 425987

percentage of lines changes-----------------------

percentage of changed lines 1 %

percentage of added lines 33 %

percentage of deleted lines 26 %

Note: if you use this script against a huge repository containing of thousands of lines to get the percentage of line modifications, additions and deletions that occured few weeks back ( 2 or 3 weeks back), sometimes the percenatages displayed will be close to 0, but the exact no of line changes will be displayed for your reference.

git-repo-stats's People

Contributors

kasunsiyambalapitiya avatar

Watchers

James Cloos avatar  avatar

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.