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.
28 typedef int CALL_UPDATE_DIFF_ASYNC(GitRevLoglist
* pRev
, void* data
);
30 class GitRevLoglist
: public GitRev
33 friend class CLogCache
;
41 CTGitPathList m_Files
;
42 CTGitPathList m_UnRevFiles
;
45 GIT_COMMIT m_GitCommit
;
50 CString m_Ref
; // for Refloglist
51 CString m_RefAction
; // for Refloglist
53 // Show version tree Graphic
54 std::vector
<int> m_Lanes
;
56 volatile LONG m_IsFull
;
57 volatile LONG m_IsUpdateing
;
58 volatile LONG m_IsCommitParsed
;
59 volatile LONG m_IsDiffFiles
;
61 CALL_UPDATE_DIFF_ASYNC
*m_CallDiffAsync
;
65 if (!m_IsDiffFiles
&& !m_CommitHash
.IsEmpty())
68 ret
= SafeFetchFullInfo(&g_Git
);
69 InterlockedExchange(&m_IsDiffFiles
, TRUE
);
70 if (m_IsDiffFiles
&& m_IsCommitParsed
)
71 InterlockedExchange(&m_IsFull
, TRUE
);
78 int& GetAction(void* data
)
81 if (!m_IsDiffFiles
&& m_CallDiffAsync
)
82 m_CallDiffAsync(this, data
);
88 int& GetRebaseAction()
90 return m_RebaseAction
;
93 CTGitPathList
& GetFiles(void* data
)
96 if (data
&& !m_IsDiffFiles
&& m_CallDiffAsync
)
97 m_CallDiffAsync(this, data
);
103 CTGitPathList
& GetUnRevFiles()
109 void CheckAndParser()
111 if (!m_IsCommitParsed
&& m_GitCommit
.m_pGitCommit
)
113 ParserFromCommit(&m_GitCommit
);
114 InterlockedExchange(&m_IsCommitParsed
, TRUE
);
115 git_free_commit(&m_GitCommit
);
116 if (m_IsDiffFiles
&& m_IsCommitParsed
)
117 InterlockedExchange(&m_IsFull
, TRUE
);
122 CString
& GetAuthorName()
128 CString
& GetAuthorEmail()
131 return m_AuthorEmail
;
134 CTime
& GetAuthorDate()
140 CString
& GetCommitterName()
143 return m_CommitterName
;
146 CString
& GetCommitterEmail()
149 return m_CommitterEmail
;
152 CTime
& GetCommitterDate()
155 return m_CommitterDate
;
158 CString
& GetSubject()
170 BOOL
IsBoundary() { return m_Mark
== _T('-'); }
172 virtual void Clear();
174 int SafeFetchFullInfo(CGit
* git
);
176 int SafeGetSimpleList(CGit
* git
);
177 volatile LONG m_IsSimpleListReady
;
178 STRING_VECTOR m_SimpleFileList
; /* use for find and filter, no rename detection and line num stat info */
180 static int GetRefLog(const CString
& ref
, std::vector
<GitRevLoglist
>& refloglist
, CString
& error
);