Fix grafted history by unshallowing repository and updating main branch#53
Fix grafted history by unshallowing repository and updating main branch#53
Conversation
Co-authored-by: nhorton <204146+nhorton@users.noreply.github.com>
|
@copilot don't close the pr - continue the investigation here. Reminder - youa re an agent. You started from main yet you got a shallow copy!!! |
|
@copilot Look at many of the open PRs. Notice that they all have the same git history in their branches showing changes in them back to a head a ways back. But that happens when the branch and the pr are made at the same time (nearly) yet the changes they show go back to a day before the branch was made. i.e. they start from the wrong head commit! |
I've confirmed the issue. Looking at open PRs:
The problem: PRs #52, #50, and #43 have base commits that are OLDER than the current HEAD of main (e813b39). This causes GitHub to show all commits between their old base and their branch head as "changes in this PR", even though those commits were already on main. This is not a grafted history issue - it's a stale base reference issue. When these branches were created, they branched off from older commits on main, but main has since moved forward to e813b39. The "Files changed" view incorrectly includes all the commits between the old base and current main. The root cause appears to be that branches are being created from outdated checkouts of main. This could be fixed by ensuring |
The repository was a shallow clone (
.git/shallowpresent), causing git to display "(grafted)" markers and new branches to start from truncated history at commit e813b39.Changes
git fetch origin main:main --unshallowto convert shallow clone to full repositorymainbranch trackingorigin/mainwith complete historyGRAFTED_HISTORY_FIX.md) explaining the issue and resolutionBefore/After
Before:
After:
Note
This fix was applied locally during PR creation. The documentation file is included for reference, but the actual issue (shallow clone) exists in individual workspaces, not in the remote repository. If shallow clones persist, investigate CI/CD checkout configurations or local clone commands.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.