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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kewillford We should be a bit careful here. Specifically,
git pushstarts with aninfo/refscall to find the current branch tips. If those tips have moved ahead of our prefetch packfiles, then those commits will require the read-object hook. This logic will prevent those commits from being sent tosend-packand hence will not be considered as--notcommits in the revision walk. This can lead to over-pushing objects.In a particularly egregious case, think about a fresh clone with
masteras the only branch favorite. I clone, make a simple change, and push. Themasterbranch has moved ahead, but now we tellpack-objectsto pack our commit and sends zero--notcommits. We will pack the entire repo and try to push it.Let me know if I'm misunderstanding the effect of this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more likely that I am missing something, as if
mastermoves ahead in a vanilla git repo, we don't have the object, so we continue without marking that as a--notcommit. Instead, we probably use ourrefs/remote/origin/...refs. I'm going to do some digging and come back to this soon.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talked with @kewillford offline and we determined that I was wrong, for multiple reasons. I was misreading some things and it took a while to shake them all out. Here is my new understanding of what's going on:
git pushcallsgit remote-httpswhich callsgit send-pack.git send-packwould trigger theread-objecthook and somehow this was causing timing issues.read-objectcalls from thesend-packlogic by understanding we are in a virtualized environment andhas_sha1_file(hash)will always return true.--notcommits passed togit pack-objects.read-objecthook will still be run bygit pack-objects, but somehow this timing change prevents the failure.