{"thread":{"id":"63506","subject":"[RFC] git-ghost: preserve “why” on deleted lines","startedAt":"2025-05-23T12:32:45Z","lastAt":"2025-05-23T19:45:30Z","messageCount":3,"participants":["Max Rhodin","Junio C Hamano","Lucas Seiki Oshiro"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"518765","messageId":"CAOc+UT0n9pRGur0d4cORU0SMQY-PNs5ekLd=LX9xc940Og+nrQ@mail.gmail.com","threadId":"63506","inReplyTo":null,"subject":"[RFC] git-ghost: preserve “why” on deleted lines","fromName":"Max Rhodin","fromEmail":"max@ux.se","sentAt":"2025-05-23T12:32:28Z","receivedAt":"2025-05-23T12:32:45Z","isPatch":false,"sender":{"key":"max@ux.se","avatar":null},"body":"Hi,\n\nI hate losing the why behind a deleted line.\n\nWhen you drop code in a review, being able to attach a brief comment\nto that line would save a lot of head-scratching.\n\nGit-ghost – see the remnants of days past in a file.\n\ngit-ghost hooks into commit to stash deleted lines in a `.ghost` file\nand enables maintainers to prompt for a short reason. Later you can run:\n\n    git ghost view <file>\n\nto see what vanished and why. Blame also becomes easier.\n\nNo core changes—pure userland. Repos can opt in or out. Also helps AI\nagents make sense of code history.\n\nCould be made in thousands of ways, but unless the deleted rows are saved\nas actual file-bound information, understanding it later and building tools\nfor it is much harder. `git note` could be used, but doesn't really solve\nthe issue.\n\nComments?\n\nMax Rhodin\nmax@ux.se\n"},{"id":"518785","messageId":"xmqqh61bxmsj.fsf@gitster.g","threadId":"63506","inReplyTo":"CAOc+UT0n9pRGur0d4cORU0SMQY-PNs5ekLd=LX9xc940Og+nrQ@mail.gmail.com","subject":"Re: [RFC] git-ghost: preserve “why” on deleted lines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-23T17:24:44Z","receivedAt":"2025-05-23T17:24:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Max Rhodin <max@ux.se> writes:\n\n> Comments?\n\nWould running \"git blame\" in reverse work for your use case?\n\nTracing deleted contents is much harder than tracing contents in the\ncurrent revision, simply because you have to find where to start\ndigging.  In order to find where the contents were removed, you\nfirst need to know what exact contents you are looking for (which\nby definition you cannot do with the current revision), and then you\nneed to know what revision had that code.\n\nWhat I do in practice is to randomly check out an old revision to\nfind sufficiently old one that still contains the contents (\"git\nbisect\" can help), and then go from there.\n\n"},{"id":"518800","messageId":"9F0F0FF5-85D8-48E8-B056-F71F56AEB915@gmail.com","threadId":"63506","inReplyTo":"CAOc+UT0n9pRGur0d4cORU0SMQY-PNs5ekLd=LX9xc940Og+nrQ@mail.gmail.com","subject":"Re: [RFC] git-ghost: preserve “why” on deleted lines","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-05-23T19:45:15Z","receivedAt":"2025-05-23T19:45:30Z","isPatch":false,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"\n> Hi,\n\nHi, Max!\n\n> I hate losing the why behind a deleted line.\n> \n> When you drop code in a review, being able to attach a brief comment\n> to that line would save a lot of head-scratching.\n\nSorry if I misunderstood you, but I can't see the difference of that\nto committing empty lines + giving a meaningful commit message.\n\n> Git-ghost – see the remnants of days past in a file.\n> \n> git-ghost hooks into commit to stash deleted lines in a `.ghost` file\n> and enables maintainers to prompt for a short reason. Later you can run:\n> \n>    git ghost view <file>\n> \n> to see what vanished and why. Blame also becomes easier.\n\nI still don't see the difference of that to git log -- <file>. I\nunderstand that git blame doesn't show what has been deleted, only what\nis new and what has changed. But ok, git blame has it's limitations of\nbeing a quick line-wise inspection tool, while more deeper analysis\nwould require more powerful tools. It looks to me that git log with\nsome flags would do what you need.\n\n"}]}