From cfb6e4b49faf27eb74519b19e5d546378f447fbb Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Wed, 29 Apr 2026 16:01:36 +0200 Subject: [PATCH] docs(git): trim three comments --- lua/git/cmd.lua | 1 - lua/git/editor.lua | 12 +++++------- lua/git/object.lua | 5 ++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lua/git/cmd.lua b/lua/git/cmd.lua index 3976dc0..2f47345 100644 --- a/lua/git/cmd.lua +++ b/lua/git/cmd.lua @@ -67,7 +67,6 @@ local function first_positional(args, start) end end ----Find or create the named scratch buffer and place it in a window. ---@param name string ---@return integer buf local function place_split(name) diff --git a/lua/git/editor.lua b/lua/git/editor.lua index 007dac9..1ce857e 100644 --- a/lua/git/editor.lua +++ b/lua/git/editor.lua @@ -4,13 +4,11 @@ local M = {} local SENTINEL = "__NVIM_GIT_EDIT__" --- Each git editor invocation runs this body afresh under `sh -c`. The --- body picks a per-invocation flag file via `$$` (the wrapping shell's --- pid), prints the sentinel + flag-path + abs-path on stderr so the --- running Neovim can find both, and polls the flag until Neovim writes --- it. Concurrent edits inside one git call (e.g. `rebase -i`'s todo --- plus N reword commits) get distinct flags because each invocation is --- a fresh shell with a fresh `$$`. +-- Per-invocation: each `sh -c` body picks a flag file via `$$`, +-- prints sentinel + flag-path + abs-path on stderr, then polls the +-- flag until Neovim writes it. `rebase -i` fires the editor many +-- times (todo + each reword). Each call is a fresh shell with a +-- fresh `$$`, so flags don't collide. local SCRIPT = string.format( [=[set -eu flag="${TMPDIR:-/tmp}/nvim-git-editor-$$.done" diff --git a/lua/git/object.lua b/lua/git/object.lua index f1736c4..cdcc3ac 100644 --- a/lua/git/object.lua +++ b/lua/git/object.lua @@ -308,9 +308,8 @@ local function open_section(ctx, section) return end local parent = ctx.parent_ref or "0" - -- blob_buf handles the absent (zero-blob) case by returning an empty - -- buffer, which keeps `:diffsplit` from triggering BufReadCmd against - -- a non-existent revspec and logging an error. + -- An empty buffer for zero blobs keeps `:diffsplit` from + -- BufReadCmd-loading a non-existent revspec. local left = blob_buf(ctx.worktree, section.pre_blob, section.pre_path, parent) local right =