Thanks to visit codestin.com
Credit goes to github.com

Skip to content

commit: split creating the commit and writing it out #3652

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

Merged
merged 1 commit into from
Mar 8, 2016

Conversation

carlosmn
Copy link
Member

@carlosmn carlosmn commented Mar 3, 2016

Sometimes you want to create a commit but not write it out to the
objectdb immediately. For these cases, provide a new function to
retrieve the buffer instead of having to go through the db.


This is new, so we should wait to merge until after the release.

@carlosmn carlosmn force-pushed the cmn/commit-to-memory branch from 261f86a to f5feb24 Compare March 7, 2016 12:40
@ethomson
Copy link
Member

ethomson commented Mar 8, 2016

Hm. So, I must admit that it seems odd to me that git_commit__create_buffer_internal does more than just stuffing the commit information into a buffer, and that it does the current_id validation for git_commit__create_internal.

I would personally rather see the git_commit__create_internal function do that test and then pass an array of commit ids to the buffer creation function, which seems like it keeps the separation of concerns a bit more separate.

@carlosmn
Copy link
Member Author

carlosmn commented Mar 8, 2016

I wasn't quite sure what to do about that. I went with keeping the solution we have which does not perform extra allocations. But come to think about it, when we split this off, the parent check doesn't mean much, as that's a check that should happen at the writing side.

Sometimes you want to create a commit but not write it out to the
objectdb immediately. For these cases, provide a new function to
retrieve the buffer instead of having to go through the db.
@carlosmn carlosmn force-pushed the cmn/commit-to-memory branch from f5feb24 to 47cb42d Compare March 8, 2016 12:11
@carlosmn
Copy link
Member Author

carlosmn commented Mar 8, 2016

I've updated the function to accept just the data, and we perform the validation at a higher level.

ethomson pushed a commit that referenced this pull request Mar 8, 2016
commit: split creating the commit and writing it out
@ethomson ethomson merged commit 534ca88 into master Mar 8, 2016
@ethomson ethomson deleted the cmn/commit-to-memory branch January 9, 2019 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants