KiCad PCB EDA Suite
Loading...
Searching...
No Matches
text_eval_vcs.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <string>
23#include <cstdint>
24
31namespace TEXT_EVAL_VCS
32{
40std::string GetCommitHash( const std::string& aPath = ".", int aLength = 40 );
41
49std::string GetNearestTag( const std::string& aMatch = "", bool aAnyTags = false );
50
58int GetDistanceFromTag( const std::string& aMatch = "", bool aAnyTags = false );
59
66bool IsDirty( bool aIncludeUntracked = false );
67
74std::string GetAuthor( const std::string& aPath = "." );
75
82std::string GetAuthorEmail( const std::string& aPath = "." );
83
90std::string GetCommitter( const std::string& aPath = "." );
91
98std::string GetCommitterEmail( const std::string& aPath = "." );
99
105std::string GetBranch();
106
113int64_t GetCommitTimestamp( const std::string& aPath = "." );
114
121std::string GetCommitDate( const std::string& aPath = "." );
122
123} // namespace TEXT_EVAL_VCS
wxString GetCommitHash()
Get the commit hash as a string.
VCS (Version Control System) utility functions for text evaluation.
std::string GetAuthor(const std::string &aPath)
Get the author name of the HEAD commit.
bool IsDirty(bool aIncludeUntracked)
Check if the repository has uncommitted changes.
std::string GetCommitterEmail(const std::string &aPath)
Get the committer email of the HEAD commit.
std::string GetCommitDate(const std::string &aPath)
Get the commit date of the HEAD commit as a timestamp string.
std::string GetAuthorEmail(const std::string &aPath)
Get the author email of the HEAD commit.
std::string GetCommitter(const std::string &aPath)
Get the committer name of the HEAD commit.
std::string GetBranch()
Get the current branch name.
std::string GetNearestTag(const std::string &aMatch, bool aAnyTags)
Get the nearest tag/label from HEAD.
int64_t GetCommitTimestamp(const std::string &aPath)
Get the commit timestamp (Unix time) of the HEAD commit.
int GetDistanceFromTag(const std::string &aMatch, bool aAnyTags)
Get the number of commits since the nearest matching tag.