forked from libgit2/libgit2
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix degraded performance using GIT_USE_NSEC on repos cloned with GIT_USE_NSEC disabled #6
Closed
julianmesa-gitkraken
wants to merge
417
commits into
nodegit:libgit-next
from
julianmesa-gitkraken:fix-nsec-on-no-nsec-repos
Closed
Fix degraded performance using GIT_USE_NSEC on repos cloned with GIT_USE_NSEC disabled #6
julianmesa-gitkraken
wants to merge
417
commits into
nodegit:libgit-next
from
julianmesa-gitkraken:fix-nsec-on-no-nsec-repos
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Push starts by connecting, don't try to connect again, just rely on the existing connection existing.
Several places in the remote code identify an error and then swallow it; return the error.
The existing mechanism for providing options to remote fetch/push calls, and subsequently to transports, is unsatisfactory. It requires an options structure to avoid breaking the API and callback signatures. 1. Introduce `git_remote_connect_options` to satisfy those needs. 2. Add a new remote connection API, `git_remote_connect_ext` that will take this new options structure. Existing `git_remote_connect` calls will proxy to that. `git_remote_fetch` and `git_remote_push` will proxy their fetch/push options to that as well. 3. Define the interaction between `git_remote_connect` and fetch/push. Connect _may_ be called before fetch/push, but _need not_ be. The semantics of which options would be used for these operations was not specified if you specify options for both connect _and_ fetch. Now these are defined that the fetch or push options will be used _if_ they were specified. Otherwise, the connect options will be used if they were specified. Otherwise, the library's defaults will be used. 4. Update the transports to understand `git_remote_connect_options`. This is a breaking change to the systems API.
The new version of our test git server adds redirect support. Upgrade to it.
We (thankfully) don't have flaky tests anymore, don't retry them.
In redirect application logic, (optionally) allow off-site redirects.
Give callers the ability to select how to handle redirects - either supporting redirects during the initial connection (so that, for example, `git.example.com/repo` can redirect to `github.com/example/repo`) or all/no redirects. This is for compatibility with git.
Test that we honor `http.followRedirects` when set to initial or false.
Co-authored-by: Edward Thomson <[email protected]>
Co-authored-by: Edward Thomson <[email protected]>
Co-authored-by: Edward Thomson <[email protected]>
Co-authored-by: Edward Thomson <[email protected]>
Co-authored-by: Edward Thomson <[email protected]>
Co-authored-by: Edward Thomson <[email protected]>
Co-authored-by: Edward Thomson <[email protected]>
Co-authored-by: Edward Thomson <[email protected]>
Now that oids are type-aware, they use their type to understand how many bytes to copy. Some callers may need to copy the raw bytes of the object id. This is equivalent to a memcpy that is a little more semantic.
The commit graph contains arrays of raw oid data, use a byte array to index into them.
A packfile contains arrays of raw oid data, use a byte array to index into them.
The index contains entries with raw oid data, use a byte array for the raw entry data.
A multi-pack index uses raw oid data, use a byte array to index into them.
The indexer expects raw oid data, provide it.
Provide individual file ownership checks for both the current user and the system user, as well as a combined current user and system user check.
Ensure that the repository directory is owned by the current user; this prevents us from opening configuration files that may have been created by an attacker.
Provide a mock for file ownership for testability.
Test that we prevent opening directories that are not owned by ourselves.
Pull the global configuration loader out of the symlink check so that it can be re-used.
Obey the `safe.directory` configuration variable if it is set in the global or system configuration. (Do not try to load this from the repository configuration - to avoid malicious repositories that then mark themselves as safe.)
Introduce the `GIT_OPT_SET_OWNER_VALIDATION` option, so that users can disable repository ownership validation.
Validate repository directory ownership
Provide a class that will display progress information to the console. Initially, it contains callbacks for fetch progress and checkout progress.
Provide a mechanism to add a signal handler for Unix or Win32.
6fc6eeb replaced the remote options with `git_remote_connect_options`. The function definitions were removed, but one function declaration remained, causing linker errors if one tried to use it. This change removes the declaration of `git_transport_smart_proxy_option` to better reflect reality.
sha256: refactoring in preparation for sha256
…art_proxy_options remote: Delete a now-inexistent API declaration
…nclude Fix missing include
The dates we use in `refs::revparse::date` has just passed the ten years, so now everything is beyond ten years, leading to an unexpected commit being returned. Adjust it to 11 years so it all looks fine again.
…USE_NSEC disabled
zawata
pushed a commit
to zawata/libgit2
that referenced
this pull request
Feb 7, 2024
Shallow clone network
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix degrade performance using GIT_USE_NSEC on repos cloned with GIT_USE_NSEC disabled.
We just mimic the GIT_USE_NSEC disabled behavior when nanoseconds are 0.
There is a edge case when nanoseconds is 0 in a repo cloned with GIT_USE_NSEC enabled, never found it but anyway that file will be handle fine just the sha1 will be generated to check if has changed.
Enabling GIT_USE_NSEC we will get a boost performance in LFS repos using long running process filter.
Using long running process filter the LFS files and the index will have similar timestamp, the only difference is nanoseconds, if you execute git_status_list_new withouth GIT_USE_NSEC then the clean filter will triggered because the seconds are the same in LFS files and index because of the batch mode ("git lfs checkout")