Code forensics  0.1
Generate historical information about code changes
repo_processing.hpp File Reference

Headers for the repository processing algorithms. More...

#include <mutex>
#include <boost/process.hpp>
#include "common.hpp"
#include "git_ir.hpp"
#include "program_state.hpp"
Include dependency graph for repo_processing.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SubTaskParams
 

Typedefs

using SLock = std::scoped_lock< std::mutex >
 

Functions

auto get_nesting (CR< Str > line) -> int
 
void push_line (ir::FileId id, walker_state *walker, CR< ir::LineData > line, bool changed, int period)
 
ir::FileId stats_via_subprocess (git_oid commit_oid, walker_state *walker, ir::File file, CR< Str > relpath)
 
ir::FileId stats_via_libgit (walker_state *state, git_oid commit_oid, const git_tree_entry *entry, CR< Str > relpath, ir::File file)
 
ir::FileId exec_walker (git_oid commit_oid, walker_state *state, ir::CommitId commit, const char *root, const git_tree_entry *entry)
 
ir::CommitId process_commit (git_oid commit_oid, walker_state *state)
 
void file_tasks (Vec< SubTaskParams > &treewalk, walker_state *state, git_oid commit_oid, ir::CommitId out_commit)
 
void open_walker (git_oid &oid, walker_state &state)
 
Vec< ir::CommitId > launch_analysis (git_oid &oid, walker_state *state)
 

Detailed Description

Headers for the repository processing algorithms.

Typedef Documentation

◆ SLock

using SLock = std::scoped_lock<std::mutex>

Function Documentation

◆ exec_walker()

ir::FileId exec_walker ( git_oid  commit_oid,
walker_state state,
ir::CommitId  commit,
const char *  root,
const git_tree_entry *  entry 
)

◆ file_tasks()

void file_tasks ( Vec< SubTaskParams > &  treewalk,
walker_state state,
git_oid  commit_oid,
ir::CommitId  out_commit 
)
Parameters
stateList of subtasks that need to be executed for each specific file.

◆ get_nesting()

auto get_nesting ( CR< Str >  line) -> int

◆ launch_analysis()

Vec<ir::CommitId> launch_analysis ( git_oid &  oid,
walker_state state 
)

◆ open_walker()

void open_walker ( git_oid &  oid,
walker_state state 
)

◆ process_commit()

ir::CommitId process_commit ( git_oid  commit_oid,
walker_state state 
)

Implementaiton of the commit processing function. Walks files that were available in the repository at the time and process each file individually, filling data into the content store.

◆ push_line()

void push_line ( ir::FileId  id,
walker_state walker,
CR< ir::LineData line,
bool  changed,
int  period 
)

Append new line to the file and update related counteres (total complexity, line count and so on)

◆ stats_via_libgit()

ir::FileId stats_via_libgit ( walker_state state,
git_oid  commit_oid,
const git_tree_entry *  entry,
CR< Str >  relpath,
ir::File  file 
)

◆ stats_via_subprocess()

ir::FileId stats_via_subprocess ( git_oid  commit_oid,
walker_state walker,
ir::File  file,
CR< Str >  relpath 
)

Start git blame subprocess

Read it's standard output

Proces is started in the specified project directory

For now we are only looking into the authoring time