-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Support index v4 #3837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support index v4 #3837
Conversation
return val; | ||
} | ||
|
||
int git_encode_varint(unsigned char *buf, uintmax_t value) |
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.
In my opinion it would be a cleaner interface design if we have the caller pass in the buffer's maximum length so we do not overflow it. Otherwise it's somewhat magical to the caller how big the buffer is required to be.
* | ||
* Valid values are 2, 3, or 4. If 2 is given, an index with version | ||
* 3 may be written instead, if necessary to accurately represent the | ||
* index. |
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.
We should mention this is the version that a git_index_write()
will use to write to disk. The part about 2 vs 3 reads as though this would write out the index.
Pretty sure these test failures are spurious and that this patch is ready to go. |
I've restarted these jobs. But you'll need to rebase the branch upon current master, as your changes now create conflicts. |
db7e813
to
de985bc
Compare
Conflicts fixed, tests pass. |
This code is ported from git.git Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: David Turner <[email protected]>
Support reading and writing index v4. Index v4 uses a very simple compression scheme for pathnames, but is otherwise similar to index v3. Signed-off-by: David Turner <[email protected]>
de985bc
to
5625d86
Compare
@pks-t I keep having to rebase to deal with ChangeLog conflicts. All of the substantive issues raised in review have been solved. CI passes. Can you (or someone else) please merge this? |
I don't have enough knowledge on the index format code, so I can't really comment on or merge this PR despite stylistic issues. |
@ethomson can you merge this? |
@novalis Sure - thanks for hacking on this! |
moved from #3789 because I no longer have access to the twitter github account.
This version leaves one in/out parameter, but I think otherwise addresses the concerns in the prev request.