-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
238 lines (218 loc) · 7.26 KB
/
Copy pathtypes.ts
File metadata and controls
238 lines (218 loc) · 7.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/** A changed file in the active local Git repository. */
export interface GitFileChange {
/** Repository-relative path using the Git status spelling. */
path: string
/** Index-side status code, or a space when unchanged. */
index: string
/** Worktree-side status code, or a space when unchanged. */
worktree: string
/** Whether the path is untracked, added, deleted, renamed, copied, or modified. */
kind: 'untracked' | 'added' | 'deleted' | 'renamed' | 'copied' | 'conflict' | 'modified'
/** Previous repository-relative path for a rename or copy status, or null for other statuses. */
previousPath: string | null
/** Browser URL for the committed HEAD version of this file, when GitHub is detected. */
fileUrl: string | null
}
/** In-progress multi-step Git state detected from the repository's git directory. */
export type GitMergeState = 'merge' | 'rebase' | null
/** Repository metadata and the current change list. */
export interface GitStatus {
/** Canonical repository root. */
root: string
/** Current branch, or a detached-HEAD label. */
branch: string
/** Configured upstream branch, when available. */
upstream: string | null
/** Commits ahead of upstream. */
ahead: number
/** Commits behind upstream. */
behind: number
/** Name of the Git remote selected by the current branch, when configured. */
remoteName: string | null
/** Git remote URL selected by the current branch, when configured. */
remoteUrl: string | null
/** Browser URL for a github.com remote, when detected. */
githubUrl: string | null
/** Name of the remote selected for push by local Git configuration. */
pushRemoteName: string | null
/** Push URL selected by local Git configuration, with credentials removed. */
pushRemoteUrl: string | null
/** Full local HEAD commit SHA, or null before the first commit. */
headSha: string | null
/** Browser URL for the local HEAD commit, when GitHub is detected. */
commitUrl: string | null
/** In-progress merge or rebase state, when detected. */
mergeState: GitMergeState
/** Changed files, capped by configuration. */
files: GitFileChange[]
/** True when the file list was capped. */
truncated: boolean
}
/** Which side of the index a requested diff represents. */
export type GitDiffMode = 'working' | 'staged'
/** One selected file's bounded unified diff. */
export interface GitDiff {
/** Repository-relative path. */
path: string
/** Unified diff text, or a useful message for binary files. */
diff: string
/** True when the diff was capped. */
truncated: boolean
}
/** How a conflicted file should be resolved. */
export type GitConflictStrategy = 'ours' | 'theirs' | 'both'
/** One local or selected-remote branch shown in the repository view. */
export interface GitBranch {
/** Short branch name. */
name: string
/** Whether HEAD currently points to this branch. */
current: boolean
/** Whether this is a remote-tracking branch. */
remote: boolean
/** Configured upstream branch, when present. */
upstream: string | null
/** Browser URL for this branch when the selected remote is a GitHub repository. */
branchUrl: string | null
}
/** Branch and browser links for the active repository. */
export interface GitRepositoryOverview {
/** Local and selected-remote tracking branches. */
branches: GitBranch[]
/** Name of the Git remote used for branch listings and browser links. */
remoteName: string | null
/** Browser URL for the detected GitHub repository. */
githubUrl: string | null
/** Browser URL for creating a pull request from the current branch. */
compareUrl: string | null
}
/** One commit in the repository history list. */
export interface GitCommitSummary {
/** Full commit SHA. */
sha: string
/** Short commit SHA. */
shortSha: string
/** First line of the commit message. */
subject: string
/** Author name. */
author: string
/** Author email. */
email: string
/** Author date in ISO 8601. */
date: string
/** Decoration refs (branch and tag names) pointing at this commit. */
refs: string[]
}
/** Capped commit history projection. */
export interface GitLog {
/** Commits, newest first, capped by configuration. */
commits: GitCommitSummary[]
/** True when the commit list was capped. */
truncated: boolean
}
/** One file touched by a commit. */
export interface GitCommitFile {
/** Repository-relative path. */
path: string
/** Change kind relative to the first parent. */
status: 'added' | 'modified' | 'deleted' | 'renamed' | 'copied'
/** Previous path for rename or copy statuses. */
previousPath: string | null
}
/** One commit's full detail and file list. */
export interface GitCommitDetail {
/** Full commit SHA. */
sha: string
/** Short commit SHA. */
shortSha: string
/** First line of the commit message. */
subject: string
/** Rest of the commit message. */
body: string
/** Author name. */
author: string
/** Author email. */
email: string
/** Author date in ISO 8601. */
date: string
/** Decoration refs pointing at this commit. */
refs: string[]
/** Files changed by the commit, capped. */
files: GitCommitFile[]
/** True when the file list was capped. */
truncated: boolean
}
/** Capped stash list projection. */
export interface GitStashList {
/** Stash entries, newest first. */
stashes: GitStash[]
}
/** One stash entry. */
export interface GitStash {
/** Full stash ref, e.g. stash@{0}. */
ref: string
/** Stash commit SHA. */
sha: string
/** Stash creation date in ISO 8601. */
date: string
/** Stash message. */
message: string
}
/** Tag list projection. */
export interface GitTagList {
/** Tags, newest first. */
tags: GitTag[]
}
/** One tag. */
export interface GitTag {
/** Tag name. */
name: string
/** Pointed-at object short SHA. */
sha: string
/** Annotation subject or empty for lightweight tags. */
subject: string
}
/** Remote list projection. */
export interface GitRemoteList {
/** Configured remotes in Git order. */
remotes: GitRemote[]
}
/** One configured remote with credential-free URLs. */
export interface GitRemote {
/** Remote name. */
name: string
/** Fetch URL with credentials removed. */
fetchUrl: string
/** Push URL with credentials removed. */
pushUrl: string
}
/** Bounded Git command output buffer projection. */
export interface GitOutput {
/** Recorded executions, newest first. */
entries: GitOutputEntry[]
}
/** One recorded Git command execution. */
export interface GitOutputEntry {
/** The command executed, always "git". */
command: string
/** Argument vector with credential material redacted. */
args: string[]
/** Whether the command exited successfully. */
ok: boolean
/** Bounded, redacted stdout/stderr text. */
output: string
/** ISO 8601 execution time. */
at: string
}
/** Resolved host configuration for the GitHub plugin. */
export interface ResolvedConfig {
/** Maximum changed files returned to the browser. */
maxFiles: number
/** Maximum diff bytes returned for one file. */
maxDiffBytes: number
/** Maximum bytes read from an untracked file for a synthetic diff. */
maxUntrackedBytes: number
/** Maximum commits returned by one history query. */
maxLogEntries: number
/** Maximum recorded command executions kept in the output buffer. */
maxOutputEntries: number
}