Code forensics  0.1
Generate historical information about code changes
CommitGraph Struct Reference

#include <repo_graph.hpp>

Public Types

using Graph = boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, CommitInfo, CommitEdge >
 
using GraphTraits = boost::graph_traits< Graph >
 
using VDesc = GraphTraits::vertex_descriptor
 
using EDesc = GraphTraits::edge_descriptor
 

Public Member Functions

int in_degree (VDesc v) const
 
int out_degree (VDesc v) const
 
CommitInfooperator[] (VDesc v)
 
CommitEdgeoperator[] (EDesc e)
 
VDesc operator[] (CR< git_oid > oid)
 
VDesc source (EDesc e) const
 
VDesc target (EDesc e) const
 
bool is_merge (VDesc v) const
 
bool is_main (VDesc v) const
 
Opt< VDescget_base (VDesc v) const
 
generator< EDescparent_commits (VDesc v) const
 
generator< EDescnext_commits (VDesc v) const
 
generator< VDesccommits () const
 
generator< Pair< VDesc, Opt< VDesc > > > commit_pairs () const
 iterate over pairs commit-base (in this order). Merge commits are also included in the iteration results, they can be filtered out using is_base() predicate. More...
 
VDesc get_desc (CR< git_oid > oid)
 
 CommitGraph (git_repository *repo)
 

Public Attributes

Graph g
 
std::unordered_map< git_oid, VDescrev_map
 
std::unordered_set< VDescmain_set
 
std::vector< VDescmain_path
 

Member Typedef Documentation

◆ EDesc

using CommitGraph::EDesc = GraphTraits::edge_descriptor

◆ Graph

using CommitGraph::Graph = boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, CommitInfo, CommitEdge>

◆ GraphTraits

using CommitGraph::GraphTraits = boost::graph_traits<Graph>

◆ VDesc

using CommitGraph::VDesc = GraphTraits::vertex_descriptor

Constructor & Destructor Documentation

◆ CommitGraph()

CommitGraph::CommitGraph ( git_repository *  repo)

Member Function Documentation

◆ commit_pairs()

generator<Pair<VDesc, Opt<VDesc> > > CommitGraph::commit_pairs ( ) const
inline

iterate over pairs commit-base (in this order). Merge commits are also included in the iteration results, they can be filtered out using is_base() predicate.

can return empty 'base' commit for starting commits

◆ commits()

generator<VDesc> CommitGraph::commits ( ) const
inline

◆ get_base()

Opt<VDesc> CommitGraph::get_base ( VDesc  v) const
inline

◆ get_desc()

CommitGraph::VDesc CommitGraph::get_desc ( CR< git_oid >  oid)

◆ in_degree()

int CommitGraph::in_degree ( VDesc  v) const
inline

◆ is_main()

bool CommitGraph::is_main ( VDesc  v) const
inline

◆ is_merge()

bool CommitGraph::is_merge ( VDesc  v) const
inline

◆ next_commits()

generator<EDesc> CommitGraph::next_commits ( VDesc  v) const
inline

◆ operator[]() [1/3]

VDesc CommitGraph::operator[] ( CR< git_oid >  oid)
inline

◆ operator[]() [2/3]

CommitEdge& CommitGraph::operator[] ( EDesc  e)
inline

◆ operator[]() [3/3]

CommitInfo& CommitGraph::operator[] ( VDesc  v)
inline

◆ out_degree()

int CommitGraph::out_degree ( VDesc  v) const
inline

◆ parent_commits()

generator<EDesc> CommitGraph::parent_commits ( VDesc  v) const
inline

◆ source()

VDesc CommitGraph::source ( EDesc  e) const
inline

◆ target()

VDesc CommitGraph::target ( EDesc  e) const
inline

Member Data Documentation

◆ g

Graph CommitGraph::g

◆ main_path

std::vector<VDesc> CommitGraph::main_path

◆ main_set

std::unordered_set<VDesc> CommitGraph::main_set

◆ rev_map

std::unordered_map<git_oid, VDesc> CommitGraph::rev_map

The documentation for this struct was generated from the following files: