Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Changes to provide option to turn off/on ofs_delta#4115

Merged
ethomson merged 1 commit intolibgit2:masterlibgit2/libgit2:masterfrom
gsaralms:users/gsaral/optionalOfsDeltagsaralms/libgit2:users/gsaral/optionalOfsDeltaCopy head branch name to clipboard
Feb 13, 2017
Merged

Changes to provide option to turn off/on ofs_delta#4115
ethomson merged 1 commit intolibgit2:masterlibgit2/libgit2:masterfrom
gsaralms:users/gsaral/optionalOfsDeltagsaralms/libgit2:users/gsaral/optionalOfsDeltaCopy head branch name to clipboard

Conversation

@gsaralms
Copy link

@gsaralms gsaralms commented Feb 8, 2017

This change provides an option in git_libgit2_opt_t which can be used in git_libgit2_opts to turn off/on ofs_delta capability in libGit2

This is related to Issue #1414 in libgit2Sharp repository
libgit2/libgit2sharp#1414

@gsaralms
Copy link
Author

@ethomson : please take a look at this PR
this is for libgit2/libgit2sharp#1414

*
* * opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled)
*
* > Enable or disable ofs_delta capability.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add some more documentation here. Here's an example (though I'm not tied to this):

Enable or disable creating "offset deltas" when creating packfiles. Offset deltas store a delta base location as an offset into the packfile from the current location, which provides a shorter encoding and thus smaller resultant packfiles. Packfiles containing offset deltas can still be read. This defaults to enabled.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 will update the comment

Copy link
Member

@ethomson ethomson Feb 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I now realize that I was rather misunderstanding the goal. It's not to create them, it's to request them to be created from the server (or not). In that case, given the broad name given to this option, I would say either:

  1. This single option controls whether we create offset deltas and will override whether we request offset deltas. If we do this, I think that the documentation should read something like:

    Enable or disable the use of "offset deltas" when creating packfiles, and the negotiation of them when talking to a remote server. Offset deltas store a delta base location as an offset into the packfile from the current location, which provides a shorter encoding and thus smaller resultant packfiles. Packfiles containing offset deltas can still be read. This defaults to enabled.

  2. Separate options for each of these two scenarios. In that case, I would change the name of this option to something like GIT_OPT_ENABLE_REMOTE_OFS_DELTA, and document it something like:

    Enable or disable requesting "offset deltas" when communicating with a remote. Offset deltas store a delta base location as an offset into the packfile from the current location, which provides a shorter encoding and thus smaller resultant packfiles. This defaults to enabled.

Note that if we go with (1), there's no more coding work to do... it appears that we simply don't support creating packfiles with ofs_deltas? (I didn't realize this until now, and somebody should sanity check me on it.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @carlosmn who may have interesting opinions or insights here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our goal is actually (1) i.e. to simply not have any "ofs_delta".
does this name "GIT_OPT_ENABLE_OFS_DELTA" convey it properly ?
any better name suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this name is scoped nicely to (1), never create packfiles with offset deltas. I also think that this is the sensible scoping for this feature. As it happens, we will never write packfiles with offset deltas (this is still surprising to me!) so that's an easy win for that part of this support. 😀

/* The minimal interval between progress updates (in seconds). */
#define MIN_PROGRESS_UPDATE_INTERVAL 0.5

bool git_ofs_delta__enabled = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name doesn't quite make sense in our naming scheme -- we try to scope things to something sort of like an "object" or - when that stops making sense - the file level. (I concede that given the filename, smart_protocol.c, this has stopped making sense here, since this was logical outgrowth from smart.c which I guess just got too big). So git_smart is the object, or concept here, and it's the prefix. Anything that applies to that scope should be double underscored.

Something like: git_smart__ofs_delta_enabled.

(If you squint really hard it seems like we're trying to make C look object oriented, which is either terrible or merely odd depending on your mood.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I was not aware of the naming scheme, will update it to git_smart__ofs_delta_enabled

@gsaralms gsaralms force-pushed the users/gsaral/optionalOfsDelta branch from 4f51a23 to 68a24f8 Compare February 10, 2017 09:50
This change provides an option in git_libgit2_opt_t which can be used in git_libgit2_opts to turn off/on ofs_delta capability in libGit2
@gsaralms gsaralms force-pushed the users/gsaral/optionalOfsDelta branch from 68a24f8 to 61acc9f Compare February 10, 2017 09:52
@gsaralms gsaralms closed this Feb 10, 2017
@gsaralms gsaralms reopened this Feb 10, 2017
@gsaralms
Copy link
Author

closed and reopened to trigger a build because failure in appveyor build didn't looked to be related to my changes

@gsaralms
Copy link
Author

@ethomson : gentle ping on this, I have updated the comment and variable name.
Please take a look

@ethomson
Copy link
Member

Thanks @gsaralms ! Looks good to me.

@ethomson ethomson merged commit c576d4f into libgit2:master Feb 13, 2017
@gsaralms gsaralms deleted the users/gsaral/optionalOfsDelta branch February 14, 2017 03:40
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.