Repository navigation
Description
Describe the bug
I'm looking at a specific feature branch on my github repo in the browser and on the Github Desktop app. There is a specific commit that exists and shows up in the browser, but I cannot find it in the "History" tab of the Desktop app (yes I have fetched origin, and the code edits from that commit are showing in my code editor). I noticed that a recent update allowed commits to be reordered, so I wonder if something went wonky there? Commits have always shown in reverse order by date, and there is a distinct gap on the date when this commit took place.
Version & OS
Version 2.9.0, macOS 11.3.1.
Steps to reproduce the behavior
Not sure it can be reproduced without access to this repo, which is private. This is the first commit I have seen affected. But I'll describe my steps anyway in case it helps:
- Toggle to feature branch in Desktop app.
- Fetch origin.
- Look for commit where particular change was made, scrolling in the History tab down to the date of the change. Scratch head (commit missing).
- Navigate browser to list of commits for this feature branch in github. Confirm that commit exists there.
Expected behavior
I expect to see the commit I'm looking for at the date that it was committed.
Actual behavior
Commit is missing from History tab in Desktop app.
Screenshots
Without showing too much, since this is a private repo, here's a snippet of the commit list from the browser (with the commit from January 20):

And a snippet of the History tab from the Desktop app (without the commit):

Logs
N/A
Additional context
N/A
Activity
sergiou87 commentedon Jun 25, 2021
Thank you for your report @sgilberg!! ❤️
We were investigating this issue reported for someone else, but we couldn't reproduce it ourselves. This other user also saw it in an older version of the app.
In theory, the app is just showing the same as
git logwould. Could you try runninggit login that repo from a terminal and see if the commit is visible there?sergiou87 commentedon Jun 25, 2021
This seems related to #3704 too. Have you tried just restarting the app or removing the repo from the app (not from your disk) and adding it again?
I also wonder if just cloning the repository again in a different folder would help to see the commit again 🤔
sgilberg commentedon Jun 25, 2021
Thanks @sergiou87! I ran
git logand I do see the commit there. I tried restarting the app (and the machine, just in case!) and still not seeing the commit. I tried removing the repository and re-adding it, still not seeing the commit. Tried recloning too, still not seeing it.It could be related to the issue you mentioned. It looks like this branch did merge in the
masterbranch also after the commit was made. Sorry I didn't see that older issue in my search before opening this one.sergiou87 commentedon Jun 25, 2021
No worries! Your feedback is awesome and super focused, which is super helpful.
It blows my mind that
git logshows it but the app doesn't, even after re-adding the repo, cloning it somewhere else, etc. 🤯 I'll think about this and get back to you next week with some ideas to try out.Thank you so much for the responsiveness and the help!!! ❤️
sergiou87 commentedon Jul 1, 2021
Just an update, I might have access to another repo where this also happens and debug there. I'll keep you posted!
sergiou87 commentedon Jul 1, 2021
Just so everyone knows, I got access to a repo where I could reproduce the issue and understand where the problem is:
Right now the app paginates the commits in the History tab. In order to load a new page, it grabs the SHA of the last commit displayed, and runs
git log <whatever-sha>^. The^at the end makes git start looking for commits starting with the parent of the given commit. First problem with this? If the last commit in a page is a merge commit, those have 2 (or more!) parents, andgitwill always choose the first one, so anything coming from the other parents will be simply lost.My first attempt to fix this was to remove the
^, so that merge parents don't present an issue. However… if the last commit in a page is a commit in a different branch, and there were other commits made before this branch was merged, those other commits will be lost:Screen.Recording.2021-07-01.at.18.53.36.mov
I have to investigate how can we reliably get all the commits that belong to the current branch efficiently. For example, checking what dotcom does exactly.
sgilberg commentedon Jul 1, 2021
@sergiou87 Excellent sleuthing!