git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC] git-ghost: preserve “why” on deleted lines

From
MRMax Rhodin <max@ux.se>
Date
May 23, 2025, 12:32 UTC
Message-ID
<CAOc+UT0n9pRGur0d4cORU0SMQY-PNs5ekLd=LX9xc940Og+nrQ@mail.gmail.com>
Hi,
I hate losing the why behind a deleted line.

When you drop code in a review, being able to attach a brief comment to that line would save a lot of head-scratching.

Git-ghost – see the remnants of days past in a file.

git-ghost hooks into commit to stash deleted lines in a `.ghost` file and enables maintainers to prompt for a short reason. Later you can run:

    git ghost view <file>
to see what vanished and why. Blame also becomes easier.

No core changes—pure userland. Repos can opt in or out. Also helps AI agents make sense of code history.

Could be made in thousands of ways, but unless the deleted rows are saved as actual file-bound information, understanding it later and building tools for it is much harder. `git note` could be used, but doesn't really solve the issue.

Comments?

Max Rhodin max@ux.se

Next: Junio C Hamano
Message 1 of 3 in “[RFC] git-ghost: preserve “why” on deleted lines”
  1. Max RhodinMay 23, 2025
  2. Junio C HamanoMay 23, 2025
  3. Lucas Seiki OshiroMay 23, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.