Guitar
|
#include <Git.h>
Classes | |
struct | Branch |
struct | CloneData |
class | CommitID |
struct | CommitItem |
class | CommitItemList |
class | Context |
class | Diff |
struct | DiffRaw |
class | FileStatus |
class | Hunk |
struct | Object |
struct | Option |
struct | Private |
struct | ReflogItem |
struct | Remote |
struct | RemoteInfo |
struct | SubmoduleItem |
struct | SubmoduleUpdateData |
struct | Tag |
struct | User |
Public Member Functions | |
Git (Context const &cx, QString const &repodir, QString const &submodpath, QString const &sshkey) | |
Git (Git &&r)=delete | |
~Git () override | |
void | setLogCallback (callback_t func, void *cookie) |
QByteArray | toQByteArray () const |
void | setGitCommand (QString const &gitcmd, const QString &sshcmd={}) |
QString | gitCommand () const |
void | clearResult () |
std::string | resultStdString () const |
QString | resultQString () const |
bool | chdirexec (std::function< bool()> const &fn) |
bool | git (QString const &arg, Option const &opt) |
bool | git (QString const &arg) |
bool | git_nolog (QString const &arg) |
bool | git_nochdir (QString const &arg) |
void | setWorkingRepositoryDir (QString const &repo, const QString &submodpath, const QString &sshkey) |
QString | workingDir () const |
const QString & | sshKey () const |
void | setSshKey (const QString &sshkey) const |
QString | getCurrentBranchName () |
bool | isValidWorkingCopy () const |
QString | version () |
bool | init () |
QStringList | getUntrackedFiles () |
CommitItemList | log_all (CommitID const &id, int maxcount) |
コミットログを取得する More... | |
std::optional< CommitItem > | log_signature (CommitID const &id) |
Git::log_signature. More... | |
CommitItemList | log (int maxcount) |
std::optional< CommitItem > | queryCommit (const CommitID &id) |
bool | clone (CloneData const &data, AbstractPtyProcess *pty) |
FileStatusList | status_s () |
std::optional< QByteArray > | cat_file (const CommitID &id) |
void | resetFile (QString const &path) |
void | resetAllFiles () |
void | removeFile (QString const &path) |
void | add_A () |
void | unstage_all () |
void | stage (QString const &path) |
void | stage (QStringList const &paths) |
void | unstage (QString const &path) |
void | unstage (QStringList const &paths) |
void | pull (AbstractPtyProcess *pty=nullptr) |
void | fetch (AbstractPtyProcess *pty=nullptr, bool prune=false) |
void | fetch_tags_f (AbstractPtyProcess *pty) |
QList< Branch > | branches () |
int | getProcessExitCode () const |
QString | diff (QString const &old_id, QString const &new_id) |
QString | diff_file (QString const &old_path, QString const &new_path) |
QList< DiffRaw > | diff_raw (CommitID const &old_id, CommitID const &new_id) |
QString | status () |
bool | commit (QString const &text, bool sign, AbstractPtyProcess *pty) |
bool | commit_amend_m (QString const &text, bool sign, AbstractPtyProcess *pty) |
bool | revert (const CommitID &id) |
bool | push_tags (AbstractPtyProcess *pty=nullptr) |
void | getRemoteURLs (QList< Remote > *out) |
void | createBranch (QString const &name) |
void | checkoutBranch (QString const &name) |
void | mergeBranch (QString const &name, MergeFastForward ff, bool squash) |
void | rebaseBranch (QString const &name) |
QString | diff_to_file (QString const &old_id, QString const &path) |
QString | errorMessage () const |
GitPtr | dup () const |
CommitID | rev_parse (QString const &name) |
QList< Tag > | tags () |
QList< Tag > | tags2 () |
bool | tag (QString const &name, const CommitID &id=QString()) |
void | delete_tag (QString const &name, bool remote) |
void | setRemoteURL (const Remote &remote) |
void | addRemoteURL (const Remote &remote) |
void | removeRemote (QString const &name) |
QStringList | getRemotes () |
User | getUser (Source purpose) |
void | setUser (User const &user, bool global) |
bool | reset_head1 () |
bool | reset_hard () |
bool | clean_df () |
void | push_u (bool set_upstream, QString const &remote, QString const &branch, bool force, AbstractPtyProcess *pty) |
QString | objectType (const CommitID &id) |
bool | rm_cached (QString const &file) |
void | cherrypick (QString const &name) |
QString | getCherryPicking () const |
QString | getMessage (const QString &id) |
bool | reflog (ReflogItemList *out, int maxcount=100) |
QByteArray | blame (QString const &path) |
QString | signingKey (Source purpose) |
bool | setSigningKey (QString const &id, bool global) |
SignPolicy | signPolicy (Source source) |
bool | setSignPolicy (Source source, SignPolicy policy) |
bool | configGpgProgram (QString const &path, bool global) |
QList< RemoteInfo > | ls_remote () |
bool | stash () |
bool | stash_apply () |
bool | stash_drop () |
QList< SubmoduleItem > | submodules () |
bool | submodule_add (const CloneData &data, bool force, AbstractPtyProcess *pty) |
bool | submodule_update (const SubmoduleUpdateData &data, AbstractPtyProcess *pty) |
Static Public Member Functions | |
static SignatureGrade | evaluateSignature (char c) |
static bool | isUncommited (CommitItem const &item) |
static QString | trimPath (QString const &s) |
static CloneData | preclone (QString const &url, QString const &path) |
static bool | isValidID (QString const &id) |
static bool | isValidID (CommitID const &id) |
static bool | isValidWorkingCopy (QString const &dir) |
static CommitItem | parseCommit (const QByteArray &ba) |
Private Member Functions | |
QStringList | make_branch_list_ () |
QByteArray | cat_file_ (const CommitID &id) |
FileStatusList | status_s_ () |
bool | commit_ (QString const &msg, bool amend, bool sign, AbstractPtyProcess *pty) |
Git () | |
QString | encodeQuotedText (QString const &str) |
Static Private Member Functions | |
static void | parseAheadBehind (QString const &s, Branch *b) |
static std::optional< CommitItem > | parseCommitItem (const QString &line) |
Private Attributes | |
Private * | m |
using Git::callback_t = bool (*)(void *, const char *, int) |
using Git::FileStatusList = std::vector<FileStatus> |
using Git::ReflogItemList = QList<ReflogItem> |
|
strong |
|
strong |
|
strong |
enum Git::SignPolicy |
|
strong |
|
private |
Git::Git | ( | Context const & | cx, |
QString const & | repodir, | ||
QString const & | submodpath, | ||
QString const & | sshkey | ||
) |
|
delete |
|
override |
void Git::add_A | ( | ) |
void Git::addRemoteURL | ( | const Remote & | remote | ) |
QByteArray Git::blame | ( | QString const & | path | ) |
QList< Git::Branch > Git::branches | ( | ) |
std::optional< QByteArray > Git::cat_file | ( | const CommitID & | id | ) |
|
private |
bool Git::chdirexec | ( | std::function< bool()> const & | fn | ) |
void Git::checkoutBranch | ( | QString const & | name | ) |
void Git::cherrypick | ( | QString const & | name | ) |
bool Git::clean_df | ( | ) |
void Git::clearResult | ( | ) |
bool Git::clone | ( | CloneData const & | data, |
AbstractPtyProcess * | pty | ||
) |
bool Git::commit | ( | QString const & | text, |
bool | sign, | ||
AbstractPtyProcess * | pty | ||
) |
|
private |
bool Git::commit_amend_m | ( | QString const & | text, |
bool | sign, | ||
AbstractPtyProcess * | pty | ||
) |
bool Git::configGpgProgram | ( | QString const & | path, |
bool | global | ||
) |
void Git::createBranch | ( | QString const & | name | ) |
void Git::delete_tag | ( | QString const & | name, |
bool | remote | ||
) |
QString Git::diff | ( | QString const & | old_id, |
QString const & | new_id | ||
) |
QString Git::diff_file | ( | QString const & | old_path, |
QString const & | new_path | ||
) |
QList< Git::DiffRaw > Git::diff_raw | ( | CommitID const & | old_id, |
CommitID const & | new_id | ||
) |
QString Git::diff_to_file | ( | QString const & | old_id, |
QString const & | path | ||
) |
GitPtr Git::dup | ( | ) | const |
|
private |
QString Git::errorMessage | ( | ) | const |
|
inlinestatic |
void Git::fetch | ( | AbstractPtyProcess * | pty = nullptr , |
bool | prune = false |
||
) |
void Git::fetch_tags_f | ( | AbstractPtyProcess * | pty | ) |
QString Git::getCherryPicking | ( | ) | const |
QString Git::getCurrentBranchName | ( | ) |
QString Git::getMessage | ( | const QString & | id | ) |
int Git::getProcessExitCode | ( | ) | const |
QStringList Git::getRemotes | ( | ) |
void Git::getRemoteURLs | ( | QList< Remote > * | out | ) |
QStringList Git::getUntrackedFiles | ( | ) |
|
inline |
bool Git::git | ( | QString const & | arg, |
Option const & | opt | ||
) |
|
inline |
|
inline |
QString Git::gitCommand | ( | ) | const |
bool Git::init | ( | ) |
|
inlinestatic |
|
inlinestatic |
|
static |
bool Git::isValidWorkingCopy | ( | ) | const |
|
static |
Git::CommitItemList Git::log | ( | int | maxcount | ) |
Git::CommitItemList Git::log_all | ( | CommitID const & | id, |
int | maxcount | ||
) |
コミットログを取得する
id | コミットID |
maxcount | 最大アイテム数 |
std::optional< Git::CommitItem > Git::log_signature | ( | CommitID const & | id | ) |
id | コミットID |
コミットに関連する署名情報を取得する
QList< Git::RemoteInfo > Git::ls_remote | ( | ) |
|
private |
void Git::mergeBranch | ( | QString const & | name, |
MergeFastForward | ff, | ||
bool | squash | ||
) |
QString Git::objectType | ( | const CommitID & | id | ) |
|
staticprivate |
|
static |
|
staticprivate |
|
static |
void Git::pull | ( | AbstractPtyProcess * | pty = nullptr | ) |
bool Git::push_tags | ( | AbstractPtyProcess * | pty = nullptr | ) |
void Git::push_u | ( | bool | set_upstream, |
QString const & | remote, | ||
QString const & | branch, | ||
bool | force, | ||
AbstractPtyProcess * | pty | ||
) |
std::optional< Git::CommitItem > Git::queryCommit | ( | const CommitID & | id | ) |
void Git::rebaseBranch | ( | QString const & | name | ) |
bool Git::reflog | ( | ReflogItemList * | out, |
int | maxcount = 100 |
||
) |
void Git::removeFile | ( | QString const & | path | ) |
void Git::removeRemote | ( | QString const & | name | ) |
bool Git::reset_hard | ( | ) |
bool Git::reset_head1 | ( | ) |
void Git::resetAllFiles | ( | ) |
void Git::resetFile | ( | QString const & | path | ) |
QString Git::resultQString | ( | ) | const |
std::string Git::resultStdString | ( | ) | const |
Git::CommitID Git::rev_parse | ( | QString const & | name | ) |
bool Git::revert | ( | const CommitID & | id | ) |
bool Git::rm_cached | ( | QString const & | file | ) |
void Git::setGitCommand | ( | QString const & | gitcmd, |
const QString & | sshcmd = {} |
||
) |
void Git::setLogCallback | ( | callback_t | func, |
void * | cookie | ||
) |
void Git::setRemoteURL | ( | const Remote & | remote | ) |
bool Git::setSigningKey | ( | QString const & | id, |
bool | global | ||
) |
bool Git::setSignPolicy | ( | Source | source, |
SignPolicy | policy | ||
) |
void Git::setSshKey | ( | const QString & | sshkey | ) | const |
void Git::setUser | ( | User const & | user, |
bool | global | ||
) |
void Git::setWorkingRepositoryDir | ( | QString const & | repo, |
const QString & | submodpath, | ||
const QString & | sshkey | ||
) |
QString Git::signingKey | ( | Source | purpose | ) |
Git::SignPolicy Git::signPolicy | ( | Source | source | ) |
const QString & Git::sshKey | ( | ) | const |
void Git::stage | ( | QString const & | path | ) |
void Git::stage | ( | QStringList const & | paths | ) |
bool Git::stash | ( | ) |
bool Git::stash_apply | ( | ) |
bool Git::stash_drop | ( | ) |
QString Git::status | ( | ) |
Git::FileStatusList Git::status_s | ( | ) |
|
private |
bool Git::submodule_add | ( | const CloneData & | data, |
bool | force, | ||
AbstractPtyProcess * | pty | ||
) |
bool Git::submodule_update | ( | const SubmoduleUpdateData & | data, |
AbstractPtyProcess * | pty | ||
) |
QList< Git::SubmoduleItem > Git::submodules | ( | ) |
bool Git::tag | ( | QString const & | name, |
const CommitID & | id = QString() |
||
) |
QList< Git::Tag > Git::tags | ( | ) |
QList< Git::Tag > Git::tags2 | ( | ) |
QByteArray Git::toQByteArray | ( | ) | const |
|
static |
void Git::unstage | ( | QString const & | path | ) |
void Git::unstage | ( | QStringList const & | paths | ) |
void Git::unstage_all | ( | ) |
QString Git::version | ( | ) |
QString Git::workingDir | ( | ) | const |
|
private |