Steps to Reproduce:
Unclear. I tried to reproduce the problem with a simplified setup, but to no avail. Here is a list of things I remember:
- button on them in source code management sidebar in quick succession (in parallel? it tooks quite a while until it finished in the background)devel checked out, potentially not up-to-date with remotedocumentation/graph-traversal-build-fixorigin/devel into documentation/graph-traversal-build-fix on a different machineWhen I checked git log the next time in a command prompt, it only gave me this:
>git log
commit b7aa332a80c16be8c74c51fb7c2f7cdb8e4e8ff2 (grafted, HEAD -> documentation/graph-traversal-build-fix, origin/documentation/graph-traversal-build-fix)
Author: Simran ...
Date: Fri Mar 8 15:18:44 2019 +0100
Merge remote-tracking branch 'origin/devel' into documentation/graph-traversal-build-fix
So the entire history of that branch looks like a single commit and is the merge commit (the one I was behind before the Checkout via the GitHub extension)
grafted. In a shallow clone of a repository, it would be expected that you see a truncated history. However, my repo wasn't a shallow clone but a normal working copy with the entire history.documentation/graph-traversal-build-fix branch looked alright, so I deleted my local branch and checked out the remote branch - but the history remained a single commitreset --hard, but this didn't change anything eitherI cloned the entire repo to a new folder, and there the branch is fine, i.e. the entire history is listed as expected. Does this mean some cache in the original working copy got corrupted?
What does the GitHub extension do exactly if you check out pull requests? Is there any chance for breaking the working copy as described? Is it caused by how the extension uses Git, or does this sound like a bug in Git itself?
If you want to analyze the (possibly) corrupted working copy, download it here: arangodb-grafted.7z (1.1 GB)
@Simran-B I had the same problem. Solution was to delete the .git/shallow file.
There's indeed a shallow file which contains a single line in my case:
b7aa332a80c16be8c74c51fb7c2f7cdb8e4e8ff2 - which is also the commit it shows as entire history on the affected branch. I renamed the file and the full history is back! Thanks @sunsations for this suggestion!
A question remains: what created this shallow file or added this commit to it respectively? Is there any git command to add to this file? As I did nothing out of the ordinary with Git exception using the Github extension of VS Code, I still believe that this was caused by the extension, and I consider that to be a bug.
I got the same problem when I started reviewing a PR through the extension. I have no idea how it got there.
I ran into this again. I believe it's because of the fetch with a depth of 1:
This really interferes with reviewing the log of pull requests. Is it possible to make this configurable?
Most helpful comment
@Simran-B I had the same problem. Solution was to delete the
.git/shallowfile.