You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

827 lines
18 KiB

4 years ago
  1. import { LogLevel } from './constants';
  2. import type { DateTimeFormat } from './system/date';
  3. export interface Config {
  4. autolinks: AutolinkReference[] | null;
  5. blame: {
  6. avatars: boolean;
  7. compact: boolean;
  8. dateFormat: DateTimeFormat | string | null;
  9. format: string;
  10. heatmap: {
  11. enabled: boolean;
  12. location: 'left' | 'right';
  13. };
  14. highlight: {
  15. enabled: boolean;
  16. locations: BlameHighlightLocations[];
  17. };
  18. ignoreWhitespace: boolean;
  19. separateLines: boolean;
  20. toggleMode: AnnotationsToggleMode;
  21. };
  22. changes: {
  23. locations: ChangesLocations[];
  24. toggleMode: AnnotationsToggleMode;
  25. };
  26. codeLens: CodeLensConfig;
  27. currentLine: {
  28. dateFormat: string | null;
  29. enabled: boolean;
  30. format: string;
  31. uncommittedChangesFormat: string | null;
  32. pullRequests: {
  33. enabled: boolean;
  34. };
  35. scrollable: boolean;
  36. };
  37. debug: boolean;
  38. deepLinks: {
  39. schemeOverride: boolean | string | null;
  40. };
  41. defaultDateFormat: DateTimeFormat | string | null;
  42. defaultDateLocale: string | null;
  43. defaultDateShortFormat: DateTimeFormat | string | null;
  44. defaultDateSource: DateSource;
  45. defaultDateStyle: DateStyle;
  46. defaultGravatarsStyle: GravatarDefaultStyle;
  47. defaultTimeFormat: DateTimeFormat | string | null;
  48. detectNestedRepositories: boolean;
  49. fileAnnotations: {
  50. command: string | null;
  51. };
  52. gitCommands: {
  53. closeOnFocusOut: boolean;
  54. search: {
  55. matchAll: boolean;
  56. matchCase: boolean;
  57. matchRegex: boolean;
  58. showResultsInSideBar: boolean | null;
  59. };
  60. skipConfirmations: string[];
  61. sortBy: GitCommandSorting;
  62. };
  63. graph: GraphConfig;
  64. heatmap: {
  65. ageThreshold: number;
  66. coldColor: string;
  67. hotColor: string;
  68. fadeLines: boolean;
  69. locations: HeatmapLocations[];
  70. toggleMode: AnnotationsToggleMode;
  71. };
  72. hovers: {
  73. annotations: {
  74. changes: boolean;
  75. details: boolean;
  76. enabled: boolean;
  77. over: 'line' | 'annotation';
  78. };
  79. autolinks: {
  80. enabled: boolean;
  81. enhanced: boolean;
  82. };
  83. currentLine: {
  84. changes: boolean;
  85. details: boolean;
  86. enabled: boolean;
  87. over: 'line' | 'annotation';
  88. };
  89. avatars: boolean;
  90. avatarSize: number;
  91. changesDiff: 'line' | 'hunk';
  92. detailsMarkdownFormat: string;
  93. enabled: boolean;
  94. pullRequests: {
  95. enabled: boolean;
  96. };
  97. };
  98. integrations: {
  99. enabled: boolean;
  100. };
  101. keymap: KeyMap;
  102. liveshare: {
  103. allowGuestAccess: boolean;
  104. };
  105. menus: boolean | MenuConfig;
  106. mode: {
  107. active: string;
  108. statusBar: {
  109. enabled: boolean;
  110. alignment: 'left' | 'right';
  111. };
  112. };
  113. modes: Record<string, ModeConfig> | null;
  114. outputLevel: OutputLevel;
  115. partners: Record<
  116. string,
  117. {
  118. enabled: boolean;
  119. [key: string]: any;
  120. }
  121. > | null;
  122. plusFeatures: {
  123. enabled: boolean;
  124. };
  125. proxy: {
  126. url: string | null;
  127. strictSSL: boolean;
  128. } | null;
  129. rebaseEditor: {
  130. ordering: 'asc' | 'desc';
  131. showDetailsView: 'open' | 'selection' | false;
  132. };
  133. remotes: RemotesConfig[] | null;
  134. showWelcomeOnInstall: boolean;
  135. showWhatsNewAfterUpgrades: boolean;
  136. sortBranchesBy: BranchSorting;
  137. sortContributorsBy: ContributorSorting;
  138. sortTagsBy: TagSorting;
  139. statusBar: {
  140. alignment: 'left' | 'right';
  141. command: StatusBarCommand;
  142. dateFormat: DateTimeFormat | string | null;
  143. enabled: boolean;
  144. format: string;
  145. reduceFlicker: boolean;
  146. pullRequests: {
  147. enabled: boolean;
  148. };
  149. tooltipFormat: string;
  150. };
  151. strings: {
  152. codeLens: {
  153. unsavedChanges: {
  154. recentChangeAndAuthors: string;
  155. recentChangeOnly: string;
  156. authorsOnly: string;
  157. };
  158. };
  159. };
  160. telemetry: {
  161. enabled: boolean;
  162. };
  163. terminal: {
  164. overrideGitEditor: boolean;
  165. };
  166. terminalLinks: {
  167. enabled: boolean;
  168. showDetailsView: boolean;
  169. };
  170. views: ViewsConfig;
  171. virtualRepositories: {
  172. enabled: boolean;
  173. };
  174. visualHistory: {
  175. queryLimit: number;
  176. };
  177. worktrees: {
  178. defaultLocation: string | null;
  179. openAfterCreate: 'always' | 'alwaysNewWindow' | 'onlyWhenEmpty' | 'never' | 'prompt';
  180. promptForLocation: boolean;
  181. };
  182. advanced: AdvancedConfig;
  183. }
  184. export const enum AnnotationsToggleMode {
  185. File = 'file',
  186. Window = 'window',
  187. }
  188. export const enum AutolinkType {
  189. Issue = 'Issue',
  190. PullRequest = 'PullRequest',
  191. }
  192. export interface AutolinkReference {
  193. prefix: string;
  194. url: string;
  195. title?: string;
  196. alphanumeric?: boolean;
  197. ignoreCase?: boolean;
  198. type?: AutolinkType;
  199. description?: string;
  200. }
  201. export const enum BlameHighlightLocations {
  202. Gutter = 'gutter',
  203. Line = 'line',
  204. Scrollbar = 'overview',
  205. }
  206. export const enum BranchSorting {
  207. DateDesc = 'date:desc',
  208. DateAsc = 'date:asc',
  209. NameAsc = 'name:asc',
  210. NameDesc = 'name:desc',
  211. }
  212. export const enum ChangesLocations {
  213. Gutter = 'gutter',
  214. Line = 'line',
  215. Scrollbar = 'overview',
  216. }
  217. export const enum CodeLensCommand {
  218. CopyRemoteCommitUrl = 'gitlens.copyRemoteCommitUrl',
  219. CopyRemoteFileUrl = 'gitlens.copyRemoteFileUrl',
  220. DiffWithPrevious = 'gitlens.diffWithPrevious',
  221. OpenCommitOnRemote = 'gitlens.openCommitOnRemote',
  222. OpenFileOnRemote = 'gitlens.openFileOnRemote',
  223. RevealCommitInView = 'gitlens.revealCommitInView',
  224. ShowCommitsInView = 'gitlens.showCommitsInView',
  225. ShowQuickCommitDetails = 'gitlens.showQuickCommitDetails',
  226. ShowQuickCommitFileDetails = 'gitlens.showQuickCommitFileDetails',
  227. ShowQuickCurrentBranchHistory = 'gitlens.showQuickRepoHistory',
  228. ShowQuickFileHistory = 'gitlens.showQuickFileHistory',
  229. ToggleFileBlame = 'gitlens.toggleFileBlame',
  230. ToggleFileChanges = 'gitlens.toggleFileChanges',
  231. ToggleFileChangesOnly = 'gitlens.toggleFileChangesOnly',
  232. ToggleFileHeatmap = 'gitlens.toggleFileHeatmap',
  233. }
  234. export const enum CodeLensScopes {
  235. Document = 'document',
  236. Containers = 'containers',
  237. Blocks = 'blocks',
  238. }
  239. export const enum ContributorSorting {
  240. CountDesc = 'count:desc',
  241. CountAsc = 'count:asc',
  242. DateDesc = 'date:desc',
  243. DateAsc = 'date:asc',
  244. NameAsc = 'name:asc',
  245. NameDesc = 'name:desc',
  246. }
  247. export const enum CustomRemoteType {
  248. AzureDevOps = 'AzureDevOps',
  249. Bitbucket = 'Bitbucket',
  250. BitbucketServer = 'BitbucketServer',
  251. Custom = 'Custom',
  252. Gerrit = 'Gerrit',
  253. GoogleSource = 'GoogleSource',
  254. Gitea = 'Gitea',
  255. GitHub = 'GitHub',
  256. GitLab = 'GitLab',
  257. }
  258. export const enum DateSource {
  259. Authored = 'authored',
  260. Committed = 'committed',
  261. }
  262. export const enum DateStyle {
  263. Absolute = 'absolute',
  264. Relative = 'relative',
  265. }
  266. export const enum FileAnnotationType {
  267. Blame = 'blame',
  268. Changes = 'changes',
  269. Heatmap = 'heatmap',
  270. }
  271. export const enum GitCommandSorting {
  272. Name = 'name',
  273. Usage = 'usage',
  274. }
  275. export const enum GraphScrollMarkerTypes {
  276. Selection = 'selection',
  277. Head = 'head',
  278. LocalBranches = 'localBranches',
  279. RemoteBranches = 'remoteBranches',
  280. Highlights = 'highlights',
  281. Stashes = 'stashes',
  282. Tags = 'tags',
  283. }
  284. export const enum GraphMinimapTypes {
  285. Selection = 'selection',
  286. Head = 'head',
  287. LocalBranches = 'localBranches',
  288. RemoteBranches = 'remoteBranches',
  289. Highlights = 'highlights',
  290. Stashes = 'stashes',
  291. Tags = 'tags',
  292. }
  293. export const enum GravatarDefaultStyle {
  294. Faces = 'wavatar',
  295. Geometric = 'identicon',
  296. Monster = 'monsterid',
  297. MysteryPerson = 'mp',
  298. Retro = 'retro',
  299. Robot = 'robohash',
  300. }
  301. export const enum HeatmapLocations {
  302. Gutter = 'gutter',
  303. Line = 'line',
  304. Scrollbar = 'overview',
  305. }
  306. export const enum KeyMap {
  307. Alternate = 'alternate',
  308. Chorded = 'chorded',
  309. None = 'none',
  310. }
  311. export const enum OutputLevel {
  312. Silent = 'silent',
  313. Errors = 'errors',
  314. Verbose = 'verbose',
  315. Debug = 'debug',
  316. }
  317. export const enum StatusBarCommand {
  318. CopyRemoteCommitUrl = 'gitlens.copyRemoteCommitUrl',
  319. CopyRemoteFileUrl = 'gitlens.copyRemoteFileUrl',
  320. DiffWithPrevious = 'gitlens.diffWithPrevious',
  321. DiffWithWorking = 'gitlens.diffWithWorking',
  322. OpenCommitOnRemote = 'gitlens.openCommitOnRemote',
  323. OpenFileOnRemote = 'gitlens.openFileOnRemote',
  324. RevealCommitInView = 'gitlens.revealCommitInView',
  325. ShowCommitsInView = 'gitlens.showCommitsInView',
  326. ShowQuickCommitDetails = 'gitlens.showQuickCommitDetails',
  327. ShowQuickCommitFileDetails = 'gitlens.showQuickCommitFileDetails',
  328. ShowQuickCurrentBranchHistory = 'gitlens.showQuickRepoHistory',
  329. ShowQuickFileHistory = 'gitlens.showQuickFileHistory',
  330. ToggleCodeLens = 'gitlens.toggleCodeLens',
  331. ToggleFileBlame = 'gitlens.toggleFileBlame',
  332. ToggleFileChanges = 'gitlens.toggleFileChanges',
  333. ToggleFileChangesOnly = 'gitlens.toggleFileChangesOnly',
  334. ToggleFileHeatmap = 'gitlens.toggleFileHeatmap',
  335. }
  336. export const enum TagSorting {
  337. DateDesc = 'date:desc',
  338. DateAsc = 'date:asc',
  339. NameAsc = 'name:asc',
  340. NameDesc = 'name:desc',
  341. }
  342. export const enum ViewBranchesLayout {
  343. List = 'list',
  344. Tree = 'tree',
  345. }
  346. export const enum ViewFilesLayout {
  347. Auto = 'auto',
  348. List = 'list',
  349. Tree = 'tree',
  350. }
  351. export const enum ViewShowBranchComparison {
  352. Branch = 'branch',
  353. Working = 'working',
  354. }
  355. export interface AdvancedConfig {
  356. abbreviatedShaLength: number;
  357. abbreviateShaOnCopy: boolean;
  358. blame: {
  359. customArguments: string[] | null;
  360. delayAfterEdit: number;
  361. sizeThresholdAfterEdit: number;
  362. };
  363. caching: {
  364. enabled: boolean;
  365. };
  366. commitOrdering: 'date' | 'author-date' | 'topo' | null;
  367. externalDiffTool: string | null;
  368. externalDirectoryDiffTool: string | null;
  369. fileHistoryFollowsRenames: boolean;
  370. fileHistoryShowAllBranches: boolean;
  371. maxListItems: number;
  372. maxSearchItems: number;
  373. messages: { [key in SuppressedMessages]: boolean };
  374. quickPick: {
  375. closeOnFocusOut: boolean;
  376. };
  377. repositorySearchDepth: number | null;
  378. similarityThreshold: number | null;
  379. }
  380. export interface GraphConfig {
  381. avatars: boolean;
  382. commitOrdering: 'date' | 'author-date' | 'topo';
  383. dateFormat: DateTimeFormat | string | null;
  384. dateStyle: DateStyle | null;
  385. defaultItemLimit: number;
  386. dimMergeCommits: boolean;
  387. experimental: {
  388. minimap: {
  389. enabled: boolean;
  390. additionalTypes: GraphMinimapTypes[];
  391. };
  392. };
  393. highlightRowsOnRefHover: boolean;
  394. scrollRowPadding: number;
  395. showDetailsView: 'open' | 'selection' | false;
  396. showGhostRefsOnRowHover: boolean;
  397. scrollMarkers: {
  398. enabled: boolean;
  399. additionalTypes: GraphScrollMarkerTypes[];
  400. };
  401. pullRequests: {
  402. enabled: boolean;
  403. };
  404. showRemoteNames: boolean;
  405. showUpstreamStatus: boolean;
  406. pageItemLimit: number;
  407. searchItemLimit: number;
  408. statusBar: {
  409. enabled: boolean;
  410. };
  411. }
  412. export interface CodeLensConfig {
  413. authors: {
  414. enabled: boolean;
  415. command: CodeLensCommand | false;
  416. };
  417. dateFormat: DateTimeFormat | string | null;
  418. enabled: boolean;
  419. includeSingleLineSymbols: boolean;
  420. recentChange: {
  421. enabled: boolean;
  422. command: CodeLensCommand | false;
  423. };
  424. scopes: CodeLensScopes[];
  425. scopesByLanguage: CodeLensLanguageScope[] | null;
  426. symbolScopes: string[];
  427. }
  428. export interface CodeLensLanguageScope {
  429. language: string | undefined;
  430. scopes?: CodeLensScopes[];
  431. symbolScopes?: string[];
  432. }
  433. export interface MenuConfig {
  434. editor:
  435. | false
  436. | {
  437. blame: boolean;
  438. clipboard: boolean;
  439. compare: boolean;
  440. history: boolean;
  441. remote: boolean;
  442. };
  443. editorGroup:
  444. | false
  445. | {
  446. blame: boolean;
  447. compare: boolean;
  448. };
  449. editorTab:
  450. | false
  451. | {
  452. clipboard: boolean;
  453. compare: boolean;
  454. history: boolean;
  455. remote: boolean;
  456. };
  457. explorer:
  458. | false
  459. | {
  460. clipboard: boolean;
  461. compare: boolean;
  462. history: boolean;
  463. remote: boolean;
  464. };
  465. scm:
  466. | false
  467. | {
  468. graph: boolean;
  469. };
  470. scmTitleInline:
  471. | false
  472. | {
  473. graph: boolean;
  474. };
  475. scmTitle:
  476. | false
  477. | {
  478. authors: boolean;
  479. graph: boolean;
  480. };
  481. scmGroupInline:
  482. | false
  483. | {
  484. stash: boolean;
  485. };
  486. scmGroup:
  487. | false
  488. | {
  489. compare: boolean;
  490. openClose: boolean;
  491. stash: boolean;
  492. };
  493. scmItemInline:
  494. | false
  495. | {
  496. stash: boolean;
  497. };
  498. scmItem:
  499. | false
  500. | {
  501. clipboard: boolean;
  502. compare: boolean;
  503. history: boolean;
  504. remote: boolean;
  505. stash: boolean;
  506. };
  507. }
  508. export interface ModeConfig {
  509. name: string;
  510. statusBarItemName?: string;
  511. description?: string;
  512. annotations?: 'blame' | 'changes' | 'heatmap';
  513. codeLens?: boolean;
  514. currentLine?: boolean;
  515. hovers?: boolean;
  516. statusBar?: boolean;
  517. }
  518. export type RemotesConfig =
  519. | {
  520. domain: string;
  521. regex: null;
  522. name?: string;
  523. protocol?: string;
  524. type: CustomRemoteType;
  525. urls?: RemotesUrlsConfig;
  526. ignoreSSLErrors?: boolean | 'force';
  527. }
  528. | {
  529. domain: null;
  530. regex: string;
  531. name?: string;
  532. protocol?: string;
  533. type: CustomRemoteType;
  534. urls?: RemotesUrlsConfig;
  535. ignoreSSLErrors?: boolean | 'force';
  536. };
  537. export interface RemotesUrlsConfig {
  538. repository: string;
  539. branches: string;
  540. branch: string;
  541. commit: string;
  542. comparison?: string;
  543. file: string;
  544. fileInBranch: string;
  545. fileInCommit: string;
  546. fileLine: string;
  547. fileRange: string;
  548. }
  549. // NOTE: Must be kept in sync with `gitlens.advanced.messages` setting in the package.json
  550. export const enum SuppressedMessages {
  551. CommitHasNoPreviousCommitWarning = 'suppressCommitHasNoPreviousCommitWarning',
  552. CommitNotFoundWarning = 'suppressCommitNotFoundWarning',
  553. CreatePullRequestPrompt = 'suppressCreatePullRequestPrompt',
  554. SuppressDebugLoggingWarning = 'suppressDebugLoggingWarning',
  555. FileNotUnderSourceControlWarning = 'suppressFileNotUnderSourceControlWarning',
  556. GitDisabledWarning = 'suppressGitDisabledWarning',
  557. GitMissingWarning = 'suppressGitMissingWarning',
  558. GitVersionWarning = 'suppressGitVersionWarning',
  559. LineUncommittedWarning = 'suppressLineUncommittedWarning',
  560. NoRepositoryWarning = 'suppressNoRepositoryWarning',
  561. RebaseSwitchToTextWarning = 'suppressRebaseSwitchToTextWarning',
  562. IntegrationDisconnectedTooManyFailedRequestsWarning = 'suppressIntegrationDisconnectedTooManyFailedRequestsWarning',
  563. IntegrationRequestFailed500Warning = 'suppressIntegrationRequestFailed500Warning',
  564. IntegrationRequestTimedOutWarning = 'suppressIntegrationRequestTimedOutWarning',
  565. }
  566. export interface ViewsCommonConfig {
  567. defaultItemLimit: number;
  568. formats: {
  569. commits: {
  570. label: string;
  571. description: string;
  572. tooltip: string;
  573. tooltipWithStatus: string;
  574. };
  575. files: {
  576. label: string;
  577. description: string;
  578. };
  579. stashes: {
  580. label: string;
  581. description: string;
  582. };
  583. };
  584. pageItemLimit: number;
  585. showRelativeDateMarkers: boolean;
  586. experimental: {
  587. multiSelect: {
  588. enabled: boolean | null | undefined;
  589. };
  590. };
  591. }
  592. export const viewsCommonConfigKeys: (keyof ViewsCommonConfig)[] = [
  593. 'defaultItemLimit',
  594. 'formats',
  595. 'pageItemLimit',
  596. 'showRelativeDateMarkers',
  597. ];
  598. interface ViewsConfigs {
  599. branches: BranchesViewConfig;
  600. commits: CommitsViewConfig;
  601. commitDetails: CommitDetailsViewConfig;
  602. contributors: ContributorsViewConfig;
  603. fileHistory: FileHistoryViewConfig;
  604. lineHistory: LineHistoryViewConfig;
  605. remotes: RemotesViewConfig;
  606. repositories: RepositoriesViewConfig;
  607. searchAndCompare: SearchAndCompareViewConfig;
  608. stashes: StashesViewConfig;
  609. tags: TagsViewConfig;
  610. worktrees: WorktreesViewConfig;
  611. }
  612. export type ViewsConfigKeys = keyof ViewsConfigs;
  613. export const viewsConfigKeys: ViewsConfigKeys[] = [
  614. 'commits',
  615. 'repositories',
  616. 'fileHistory',
  617. 'lineHistory',
  618. 'branches',
  619. 'remotes',
  620. 'stashes',
  621. 'tags',
  622. 'contributors',
  623. 'searchAndCompare',
  624. 'worktrees',
  625. ];
  626. export type ViewsConfig = ViewsCommonConfig & ViewsConfigs;
  627. export interface BranchesViewConfig {
  628. avatars: boolean;
  629. branches: {
  630. layout: ViewBranchesLayout;
  631. };
  632. files: ViewsFilesConfig;
  633. pullRequests: {
  634. enabled: boolean;
  635. showForBranches: boolean;
  636. showForCommits: boolean;
  637. };
  638. reveal: boolean;
  639. showBranchComparison: false | ViewShowBranchComparison.Branch;
  640. }
  641. export interface CommitsViewConfig {
  642. avatars: boolean;
  643. branches: undefined;
  644. files: ViewsFilesConfig;
  645. pullRequests: {
  646. enabled: boolean;
  647. showForBranches: boolean;
  648. showForCommits: boolean;
  649. };
  650. reveal: boolean;
  651. showBranchComparison: false | ViewShowBranchComparison;
  652. }
  653. export interface CommitDetailsViewConfig {
  654. avatars: boolean;
  655. files: ViewsFilesConfig;
  656. autolinks: {
  657. enabled: boolean;
  658. enhanced: boolean;
  659. };
  660. pullRequests: {
  661. enabled: boolean;
  662. };
  663. }
  664. export interface ContributorsViewConfig {
  665. avatars: boolean;
  666. files: ViewsFilesConfig;
  667. pullRequests: {
  668. enabled: boolean;
  669. showForCommits: boolean;
  670. };
  671. reveal: boolean;
  672. showAllBranches: boolean;
  673. showStatistics: boolean;
  674. }
  675. export interface FileHistoryViewConfig {
  676. avatars: boolean;
  677. files: ViewsFilesConfig;
  678. }
  679. export interface LineHistoryViewConfig {
  680. avatars: boolean;
  681. }
  682. export interface RemotesViewConfig {
  683. avatars: boolean;
  684. branches: {
  685. layout: ViewBranchesLayout;
  686. };
  687. files: ViewsFilesConfig;
  688. pullRequests: {
  689. enabled: boolean;
  690. showForBranches: boolean;
  691. showForCommits: boolean;
  692. };
  693. reveal: boolean;
  694. }
  695. export interface RepositoriesViewConfig {
  696. autoRefresh: boolean;
  697. autoReveal: boolean;
  698. avatars: boolean;
  699. branches: {
  700. layout: ViewBranchesLayout;
  701. showBranchComparison: false | ViewShowBranchComparison.Branch;
  702. };
  703. compact: boolean;
  704. files: ViewsFilesConfig;
  705. includeWorkingTree: boolean;
  706. pullRequests: {
  707. enabled: boolean;
  708. showForBranches: boolean;
  709. showForCommits: boolean;
  710. };
  711. showBranchComparison: false | ViewShowBranchComparison;
  712. showBranches: boolean;
  713. showCommits: boolean;
  714. showContributors: boolean;
  715. showIncomingActivity: boolean;
  716. showRemotes: boolean;
  717. showStashes: boolean;
  718. showTags: boolean;
  719. showUpstreamStatus: boolean;
  720. showWorktrees: boolean;
  721. }
  722. export interface SearchAndCompareViewConfig {
  723. avatars: boolean;
  724. files: ViewsFilesConfig;
  725. pullRequests: {
  726. enabled: boolean;
  727. showForCommits: boolean;
  728. };
  729. }
  730. export interface StashesViewConfig {
  731. files: ViewsFilesConfig;
  732. reveal: boolean;
  733. }
  734. export interface TagsViewConfig {
  735. avatars: boolean;
  736. branches: {
  737. layout: ViewBranchesLayout;
  738. };
  739. files: ViewsFilesConfig;
  740. reveal: boolean;
  741. }
  742. export interface WorktreesViewConfig {
  743. avatars: boolean;
  744. files: ViewsFilesConfig;
  745. pullRequests: {
  746. enabled: boolean;
  747. showForBranches: boolean;
  748. showForCommits: boolean;
  749. };
  750. reveal: boolean;
  751. showBranchComparison: false | ViewShowBranchComparison.Branch;
  752. }
  753. export interface ViewsFilesConfig {
  754. compact: boolean;
  755. layout: ViewFilesLayout;
  756. threshold: number;
  757. }
  758. export function fromOutputLevel(level: LogLevel | OutputLevel): LogLevel {
  759. switch (level) {
  760. case OutputLevel.Silent:
  761. return LogLevel.Off;
  762. case OutputLevel.Errors:
  763. return LogLevel.Error;
  764. case OutputLevel.Verbose:
  765. return LogLevel.Info;
  766. case OutputLevel.Debug:
  767. return LogLevel.Debug;
  768. default:
  769. return level;
  770. }
  771. }