1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2015 - TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "GitStatus.h"
27 typedef std::vector
<CGitHash
> GIT_REV_LIST
;
29 #define LOG_REV_AUTHOR_NAME _T('0')
30 #define LOG_REV_AUTHOR_EMAIL _T('1')
31 #define LOG_REV_AUTHOR_DATE _T('2')
32 #define LOG_REV_COMMIT_NAME _T('3')
33 #define LOG_REV_COMMIT_EMAIL _T('4')
34 #define LOG_REV_COMMIT_DATE _T('5')
35 #define LOG_REV_COMMIT_SUBJECT _T('6')
36 #define LOG_REV_COMMIT_BODY _T('7')
37 #define LOG_REV_COMMIT_HASH _T('8')
38 #define LOG_REV_COMMIT_PARENT _T('9')
39 #define LOG_REV_COMMIT_FILE _T('A')
40 #define LOG_REV_ITEM_BEGIN _T('B')
41 #define LOG_REV_ITEM_END _T('C')
47 CString m_AuthorEmail
;
49 CString m_CommitterName
;
50 CString m_CommitterEmail
;
51 CTime m_CommitterDate
;
59 CString
GetAuthorName()
64 CString
GetAuthorEmail()
74 CString
GetCommitterName()
76 return m_CommitterName
;
79 CString
GetCommitterEmail()
81 return m_CommitterEmail
;
84 CTime
GetCommitterDate()
86 return m_CommitterDate
;
103 REV_HEAD
= -1, ///< head revision
104 REV_BASE
= -2, ///< base revision
105 REV_WC
= -3, ///< revision of the working copy
106 REV_UNSPECIFIED
= -4, ///< unspecified revision
109 static CString
GetHead(){return CString(_T("HEAD"));};
110 static CString
GetWorkingCopy(){return CString(GIT_REV_ZERO
);};
112 CGitHash m_CommitHash
;
113 GIT_REV_LIST m_ParentHash
;
115 virtual void Clear();
116 inline int ParentsCount(){ return (int)m_ParentHash
.size(); }
118 int ParserFromCommit(GIT_COMMIT
*commit
);
119 int ParserParentFromCommit(GIT_COMMIT
*commit
);
121 int ParserFromCommit(const git_commit
* commit
);
122 int ParserParentFromCommit(const git_commit
* commit
);
123 int GetCommitFromHash(git_repository
* repo
, const CGitHash
& hash
);
124 int GetCommit(git_repository
* repo
, const CString
& Rev
);
126 int GetParentFromHash(CGitHash
&hash
);
127 int GetCommitFromHash(CGitHash
&hash
);
128 int GetCommit(const CString
& rev
);
130 CString
GetLastErr() { return m_sErr
; }
135 int GetCommitFromHash_withoutLock(CGitHash
&hash
);