GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codevey/parse-git-numstat: Parses git logs created with attached numstat option

BranchesTags
Open more actions menu

Latest commit

 

History

25 Commits
25 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
lib
lib
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.prettierrc.json
.prettierrc.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

Parse Git Numstat

Parses git logs created with attached numstat option like git log --numstat > gitlog.txt

CircleCI

Usage

npm i parse-git-numstat
    const fs = require('fs');
    const parse = require('parse-git-numstat');

    const gitlog = fs.readFileSync('location/to/gitlog.txt', { encoding: 'utf-8' });
    const commits = parse(gitlog);

    console.log(commits[0]);

Prints

{ sha: '...',
    branches: [...],    // field available when using --decorate
    tags: [...],        // field available when using --decorate
    author: { name: '...', email: '...' },
    merge: null,
    date: '2019-06-01T15:49:20.000Z',
    message: 'chore: initial commit',
    stat: [
        { added: 16, deleted: 0, filepath: '.editorconfig' },
        { added: 7, deleted: 0, filepath: '.gitignore' },
        { added: 23, deleted: 0, filepath: 'README.md' },
        { added: 16, deleted: 0, filepath: 'index.js' },
        { added: 30, deleted: 0, filepath: 'lib/i2c-connection-async.js' },
        { added: 134, deleted: 0, filepath: 'lib/sensor.js' },
        { added: 21, deleted: 0, filepath: 'lib/util.js' },
        { added: 4187, deleted: 0, filepath: 'package-lock.json' },
        { added: 34, deleted: 0, filepath: 'package.json' },
        { added: 9, deleted: 0, filepath: 'test.js' }
    ]
}

Parsing Branches and Tags

If tags and branches should be parsed the git log has to be generate using the --decorate switch

git log --numstat --decorate > gitlog.txt

or

git log --numstat --decorate=full > gitlog.txt

About

Parses git logs created with attached numstat option

Topics

gitgitlognumstatparser

Resources

Readme
Activity
Custom properties

Stars

4 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.