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

@ -1,7 +1,8 @@
<script setup lang="ts">
/**
* The project tree's context menu for a file (M4.3): Open and Show Diff
* (`vcs.showDiff {path}`, dimmed while the command is disabled).
* The project tree's context menu for a file (M4.3): Open, Show Diff
* (`vcs.showDiff {path}`) and Show History (`vcs.showHistory {path}`,
* M4.6), the Git items dimmed while their command is disabled.
*
* Follows the WAI-ARIA menu pattern: it takes the focus when it opens,
* Up/Down move between items (wrapping), Enter or Space runs one, Escape,
@ -13,6 +14,7 @@ import { useCommandsStore } from "../../commands/store";
import { t } from "../../i18n";
import { useEditorStore } from "../../stores/editor";
import { SHOW_DIFF_COMMAND } from "../vcs/diff/diff";
import { SHOW_HISTORY_COMMAND } from "../vcs/log/log";
const props = defineProps<{
/** Project-relative path of the file. */
@ -66,6 +68,12 @@ const items = computed<MenuItem[]>(() => [
enabled: commands.isEnabled(SHOW_DIFF_COMMAND),
run: () => commands.execute(SHOW_DIFF_COMMAND, { path: props.path }),
},
{
id: "showHistory",
label: t("project.tree.menu.showHistory"),
enabled: commands.isEnabled(SHOW_HISTORY_COMMAND),
run: () => commands.execute(SHOW_HISTORY_COMMAND, { path: props.path }),
},
]);
/** The menu's position, kept inside the window. */