SlHelpers
Toggle main menu visibility
Loading...
Searching...
No Matches
PatchesAuthors.h
1
// SPDX-License-Identifier: GPL-2.0-only
2
3
#pragma once
4
5
#include <filesystem>
6
#include <functional>
7
#include <map>
8
#include <string>
9
10
namespace
SlGit {
11
class
Commit
;
12
class
Repo
;
13
}
14
15
namespace
SlKernCVS {
16
23
class
PatchesAuthors
{
24
public
:
26
using
Map
= std::map<std::string, std::map<std::string, unsigned int>>;
28
using
InsertUser
= std::function<bool (
const
std::string &email)>;
30
using
InsertUFMap
= std::function<bool (
const
std::string &email,
31
const
std::filesystem::path &file,
unsigned
gitFixes,
unsigned
realFixes)>;
32
39
PatchesAuthors
(
const
SlGit::Repo
&repo,
bool
dumpRefs,
bool
reportUnhandled) :
40
repo(&repo), dumpRefs(dumpRefs), reportUnhandled(reportUnhandled)
41
{}
42
50
bool
processAuthors
(
const
SlGit::Commit
&commit,
const
InsertUser
&insertUser,
51
const
InsertUFMap
&insertUFMap);
52
private
:
53
PatchesAuthors
() : repo(nullptr), dumpRefs(false), reportUnhandled(false) {}
54
friend
void
testProcessPatch();
55
56
int
processPatch(
const
std::filesystem::path &file,
const
std::string &content);
57
58
const
SlGit::Repo
*repo;
59
const
bool
dumpRefs;
60
const
bool
reportUnhandled;
61
Map
m_HoH;
62
Map
m_HoHReal;
63
Map
m_HoHRefs;
64
};
65
66
}
SlGit::Commit
Commit is a representation of a git commit.
Definition
Commit.h:21
SlGit::Repo
The most important Git class.
Definition
Repo.h:45
SlKernCVS::PatchesAuthors::Map
std::map< std::string, std::map< std::string, unsigned int > > Map
E-mail -> file -> count mapping.
Definition
PatchesAuthors.h:26
SlKernCVS::PatchesAuthors::InsertUser
std::function< bool(const std::string &email)> InsertUser
A callback invoked for e-mail.
Definition
PatchesAuthors.h:28
SlKernCVS::PatchesAuthors::PatchesAuthors
PatchesAuthors(const SlGit::Repo &repo, bool dumpRefs, bool reportUnhandled)
PatchesAuthors constructor.
Definition
PatchesAuthors.h:39
SlKernCVS::PatchesAuthors::processAuthors
bool processAuthors(const SlGit::Commit &commit, const InsertUser &insertUser, const InsertUFMap &insertUFMap)
The real work function of this class.
SlKernCVS::PatchesAuthors::InsertUFMap
std::function< bool(const std::string &email, const std::filesystem::path &file, unsigned gitFixes, unsigned realFixes)> InsertUFMap
A callback invoked for e-mail, file, and counts of git-fixes and real changes.
Definition
PatchesAuthors.h:30
include
kerncvs
PatchesAuthors.h
Generated by
1.17.0