Avoid crash when git graph and log outputs desync on branch switch#1920
Open
MaxShymko wants to merge 1 commit intoNeogitOrg:masterfrom
Open
Avoid crash when git graph and log outputs desync on branch switch#1920MaxShymko wants to merge 1 commit intoNeogitOrg:masterfrom
MaxShymko wants to merge 1 commit intoNeogitOrg:masterfrom
Conversation
Member
|
I tried the reproduction and didn't encounter an error - are you suggesting to switch branches and open the git log in very rapid succession? |
Author
|
Hm, that sounds strange. I probably have something else that causes this behavior 🤷♂️ Basically, I just open :Neogit, then press b, then r, and select another branch. No rapid toggling is needed. CleanShot.2026-03-25.at.16.56.58.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: Switching branches could crash Neogit with “No commit found for oid …” in log.lua. A minimal repro is here: https://github.com/MaxShymko/neogit-branch-switch (telescope enabled).
Root cause: For ASCII graphs Neogit runs two separate git log calls (one for commits, one for graph). During branch switches these can observe different repo states, so the graph can reference an OID not present in the commit list.
Fix: Treat missing OIDs as a normal case and render the graph line without asserting. This prevents the crash while preserving log output.