Show the detected git binary in the settings

This commit is contained in:
Rūdolfs Ošiņš
2026-09-08 10:04:49 +02:00
parent f6050ecae9
commit 535f5e2a18
6 changed files with 102 additions and 15 deletions
+27
View File
@@ -1,9 +1,11 @@
<script lang="ts">
import type { GitInfo } from "@bindings/config/GitInfo";
import type { ComponentProps } from "svelte";
import type { DiffOptions } from "@app/lib/diffOptions.svelte";
import { diffOptions } from "@app/lib/diffOptions.svelte";
import { hints } from "@app/lib/hints";
import { invoke } from "@app/lib/invoke";
import { hide } from "@app/lib/modal";
import { updateChecker } from "@app/lib/updateChecker.svelte";
import { pluralize } from "@app/lib/utils";
@@ -28,6 +30,10 @@
title?: string;
};
// Shown so that a user seeing the slower fallback can tell which git, if
// any, was picked.
const gitInfo = invoke<GitInfo>("git_info");
const diffStyleOptions: Option<DiffOptions["diffStyle"]>[] = [
{ value: "unified", icon: "diff-unified", title: "Unified" },
{ value: "split", icon: "diff-split", title: "Split" },
@@ -109,6 +115,9 @@
.section {
border-top: 1px solid var(--color-border-subtle);
}
.git {
overflow-wrap: anywhere;
}
.footer {
padding: 4rem 1.5rem 1.5rem;
font: var(--txt-body-m-regular);
@@ -186,6 +195,24 @@
Reset
</Button>
</div>
<div class="row">
<div class="row-label">
<span class="row-title">Git binary</span>
{#await gitInfo}
<span class="row-description">Looking for git…</span>
{:then info}
<span class="row-description git txt-selectable">
{info?.path
? `${info.version ?? "git"} at ${info.path}`
: "None found, using a slower built-in fallback"}
</span>
{:catch}
<span class="row-description">
Could not tell which git is in use
</span>
{/await}
</div>
</div>
</div>
<!-- How every diff in the app is drawn — the commit view, a patch's changes
and a review all read these. Kept apart from the rest because they are