<commit_before>const gitCore = require("./gitCore.js")

const defRepoDir = ".git",
      bigRepoPath = "../nodegit/.git";

let list = function (repoDir, amount = 10, verbose = false) {
    let files = {};
    let tuples = [];

    gitCore.getDiffs(repoDir, function (commit) {
        // console.log(commit.path);        
        if (files[commit.path] === undefined) {
            files[commit.path] = 1;
            // console.log(files[commit.path])
        }
        else {
            files[commit.path] += 1;
            // console.log(files[commit.path])            
        }
    })
    .then(function() {
        // console.log(files)

        for (let path in files) {
            tuples.push([path, files[path]])
        }

        tuples.sort(function (a, b) {
            a = a[1];
            b = b[1];

            return a < b ? -1 : (a > b ? 1 : 0);
        })
        .reverse();

        // console.log(tuples)

        tuples.forEach((tuple) => {
            console.log(tuple[0] + ": " + tuple[1] + " commits");
        })
    });


    
    
    
    
};

module.exports.list = list;<commit_msg>removed files no longer displayed<commit_after>const gitCore = require("./gitCore.js")

const defRepoDir = ".git",
      bigRepoPath = "../nodegit/.git";

let list = function (repoDir, amount = 10, verbose = false) {
    let files = {};
    let tuples = [];

    gitCore.getDiffs(repoDir, function (commit) {
        // console.log(commit.path);
        // console.log(commit);        
        // console.log("\n\n\n\n\n")
                
        if (files[commit.path] === undefined) {
            files[commit.path] = 1;
            // console.log(files[commit.path])
        }
        else {
            files[commit.path] += 1;
            // console.log(files[commit.path])            
        }
    })
    .then(function() {
        // console.log(files)

        for (let path in files) {
            tuples.push([path, files[path]])
        }

        tuples.sort(function (a, b) {
            a = a[1];
            b = b[1];

            return a < b ? -1 : (a > b ? 1 : 0);
        })
        .reverse();

        // console.log(tuples)

        tuples.forEach((tuple) => {
            const fs = require('fs');

            if (fs.existsSync(tuple[0])) {
                console.log(tuple[0] + ": " + tuple[1] + " commits");
            }
        })
    });


    
    
    
    
};

module.exports.list = list;
{'fraction_non_alphanumeric': 0.16598360655737704, 'fraction_numerical': 0.009426229508196722, 'mean_word_length': 1.4049261083743843, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7409402', 'n_tokens_mistral': 789, 'n_tokens_neox': 760, 'n_words': 142}