10 #include <string_view> 29 using InsertUser = std::function<bool (const std::string &email)>;
31 using InsertUFMap = std::function<bool (
const std::string &email,
32 std::filesystem::path &&file,
33 unsigned fixes,
unsigned realFixes)>;
42 repo(&repo), dumpRefs(dumpRefs), reportUnhandled(reportUnhandled)
57 unsigned realFixes = 0;
60 using Map = std::map<std::string, std::map<std::string, Counts>>;
62 using RefMap = std::map<std::string, std::map<std::string, unsigned int>>;
64 PatchesAuthors() : repo(nullptr), dumpRefs(false), reportUnhandled(false) {}
65 friend void testProcessPatch();
67 static constexpr std::string_view parseEmail(std::string_view line, std::size_t atSignPos);
68 static constexpr std::optional<std::string_view> isInterestingLine(std::string_view line);
69 static constexpr
bool isGitFixes(std::string_view line);
70 static constexpr
bool isReallyEmail(std::string_view line);
71 static constexpr
bool isValidRef(std::string_view ref);
72 void storeParens(
const char *&parenStart, std::string_view ref,
73 const std::vector<std::string> &patchEmails);
74 bool consumeParens(std::string_view ref,
const char *&parenStart,
75 const std::vector<std::string> &patchEmails);
77 int processPatch(
const std::filesystem::path &file,
const std::string &content);
81 const bool reportUnhandled;
82 Map m_emailFileCountMap;
83 RefMap m_emailRefCountMap;
std::function< bool(const std::string &email, std::filesystem::path &&file, unsigned fixes, unsigned realFixes)> InsertUFMap
A callback invoked for e-mail, file, and counts of fixes and non-git-fixes.
Definition: PatchesAuthors.h:33
PatchesAuthors parses all patches in all ("build") branches in the kernel-source tree and reports who...
Definition: PatchesAuthors.h:26
The most important Git class.
Definition: Repo.h:45
Commit is a representation of a git commit.
Definition: Commit.h:21
PatchesAuthors(const SlGit::Repo &repo, bool dumpRefs, bool reportUnhandled)
PatchesAuthors constructor.
Definition: PatchesAuthors.h:41
Definition: Branches.h:15
bool processAuthors(const SlGit::Commit &commit, const InsertUser &insertUser, const InsertUFMap &insertUFMap)
The real work function of this class.
std::function< bool(const std::string &email)> InsertUser
A callback invoked for e-mail.
Definition: PatchesAuthors.h:29