M4.6: Git log and file history

- crates/vcs log.rs: Repo::log (topological, all refs, paging, literal
  message/author filters, a path's history with --follow), show_commit
  (message and files against the first parent, renames) and show_at
  (a file at any commit); parsers property-tested.
- Engine git.log, git.showCommit, git.showAt in cmd/git_log.rs through
  the step-1 hook.
- Log tab in the bottom panel: graph lanes carried across pages, ref
  badges, filters, lazy paging, keyboard; commit details whose files open
  a read-only diff at that commit in M4.3's viewer.
- vcs.showLog and vcs.showHistory (menu, tree context menu, active
  editor tab), no default shortcuts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-28 18:00:24 +01:00
parent b814c49733
commit a8531825a3
27 changed files with 3349 additions and 16 deletions

View file

@ -13,7 +13,8 @@ import { X } from "@lucide/vue";
import { t } from "../../i18n";
import { useEditorStore } from "../../stores/editor";
import { useVcsStatusStore } from "../../stores/vcsStatus";
import { useDiffStore } from "../vcs/diff/diff";
import { SHORT_HASH } from "../vcs/changes/changes";
import { useDiffStore, type DiffTab } from "../vcs/diff/diff";
const editor = useEditorStore();
const vcs = useVcsStatusStore();
@ -38,6 +39,19 @@ function activateTab(id: number): void {
editor.activate(id);
}
/**
* The title of a diff tab: the file name, marked for the staged view or
* with the short hash of a commit tab.
*
* @param tab - the diff tab.
*/
function diffTitle(tab: DiffTab): string {
if (tab.commit) {
return t("vcs.diff.tabTitleCommit", { name: tab.name, hash: tab.commit.hash.slice(0, SHORT_HASH) });
}
return tab.staged ? t("vcs.diff.tabTitleStaged", { name: tab.name }) : t("vcs.diff.tabTitle", { name: tab.name });
}
/**
* Closes a diff tab on a middle click.
*
@ -143,7 +157,7 @@ function onKeydown(event: KeyboardEvent): void {
@mousedown.middle.prevent
@auxclick="onDiffAuxClick($event, tab.key)"
>
<span class="tabs__name">{{ tab.staged ? t("vcs.diff.tabTitleStaged", { name: tab.name }) : t("vcs.diff.tabTitle", { name: tab.name }) }}</span>
<span class="tabs__name">{{ diffTitle(tab) }}</span>
<button
class="tabs__close"
type="button"