This repository was archived by the owner on Sep 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 534
remote: use reference deltas on push when the remote server does not support offset deltas #952
Closed
Conversation
This file contains hidden or 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
…e equal. Fixes #725 Signed-off-by: Alexandr Krylovskiy <[email protected]>
Fixes #827 Signed-off-by: Dustin Frisch <[email protected]>
Signed-off-by: Mike Lundy <[email protected]>
This adds a few methods: * CreateTag, which can be used to create both lightweight and annotated tags with a supplied TagObjectOptions struct. PGP signing is possible as well. * Tag, to fetch a single tag ref. As opposed to Tags or TagObjects, this will also fetch the tag object if it exists and return it along with the output. Lightweight tags just return the object as nil. * DeleteTag, to delete a tag. This simply deletes the ref. The object is left orphaned to be GCed later. I'm not 100% sure if DeleteTag is the correct behavior - looking for details on exactly *what* happens to a tag object if you delete the ref and not the tag were sparse, and groking the Git source did not really produce much insight to the untrained eye. This may be something that comes up in review. If deletion of the object is necessary, the in-memory storer may require some updates to allow DeleteLooseObject to be supported. Signed-off-by: Chris Marchesi <[email protected]>
As with the update in ec3d2a8, tag encoding needed to be corrected to ensure extra newlines were not being added in during tag object encoding, so that it did not corrupt the object for verification. Signed-off-by: Chris Marchesi <[email protected]>
Tag encoding/decoding seems to be a lot more sensitive to requiring the exact expected format in the object, which generally includes messages canonicalized so that they have a newline on the end (even if they didn't before). As such, the message should be written with the newline (no need for an extra), and the PGP signature right after that, which will be newline split already, so there's no need to split it again. All of this means it's very important for the caller to send the message in the correct format - which I'm correcting in the next commit. Signed-off-by: Chris Marchesi <[email protected]>
Tag messages are highly sensitive to being in the expected format, especially when encoding/decoding for PGP verification. As such, we do a simple trimming of whitespace on the incoming message and add a newline on the end, to ensure there are no surprises here. Signed-off-by: Chris Marchesi <[email protected]>
The old one was created with defaults, which would have caused CI failures in 2 years. The new one is valid for 10 years: > gpg --list-secret-keys /root/.gnupg/pubring.kbx ------------------------ sec rsa4096 2018-08-22 [SC] [expires: 2028-08-19] 93A17FF01E54328546087C8E029395402EFCCD53 uid [ unknown] foo bar <[email protected]> Signed-off-by: Chris Marchesi <[email protected]>
I figured there was a way to do this without having to have TagObjectOptions supply this in - there is. Added support for this in and removed the object type from TagObjectOptions. Signed-off-by: Chris Marchesi <[email protected]>
I've mainly noticed that in using the current Tag function, that there were lots of times that I was ignoring the ref or the object, depending on what I needed. This was evident in the tests as well. As such, I think it just makes more sense for a singular tag fetcher to return just a ref, through which the caller may grab the annotation if they need it, and if it exists. Also, contrary to the docs on Tags, all tags have a ref, even if they are annotated. The difference between a lightweight tag and an annotated tag is the presence of the tag object, which the ref will point to if the tag is annotated. As such I've adjusted the docs with an example as to how one can get the annotation for a tag ref through the iterator. Source: https://git-scm.com/book/en/v2/Git-Internals-Git-References, tags section. Signed-off-by: Chris Marchesi <[email protected]>
Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
Signed-off-by: kuba-- <[email protected]>
…support offset deltas
This is to avoid any ambiguity with the act of "fetching" in git in general. Signed-off-by: Chris Marchesi <[email protected]>
This is necessary to support pruning on Tag objects. Signed-off-by: Chris Marchesi <[email protected]>
Deleting a tag ref for an annotated tag in normal git behavior does not delete the tag object right away. This is handled by the normal GC process. Signed-off-by: Chris Marchesi <[email protected]>
Added a couple of tests for annotated tag deletion: * The first one is a general test and should work regardless of the fixture used - the tag object could possibly be packed, so we do a prune *and* a repack operation before testing to see if the object was GCed correctly. * The second one actually creates the tag to be deleted, so that the tag object gets created as a loose, unpacked object. This is so we can effectively test that purning unpacked objects is now working 100% correctly (this was failing before because tag objects were not supported for walking). Signed-off-by: Chris Marchesi <[email protected]>
Just renaming the TagObjectOptions type to CreateTagOptions so that it's consistent with the other option types. Signed-off-by: Chris Marchesi <[email protected]>
Expose Storage cache.
Fix `fatal: corrupt patch` error in unified diff format
@bashims can you sign the DCO and add a test? |
Signed-off-by: Máximo Cuadros <[email protected]>
git: Add tagging support
Signed-off-by: Máximo Cuadros <[email protected]>
@mcuadros absolutely. |
The PR looks perfect, let's see the test cases. |
Signed-off-by: kuba-- <[email protected]>
git: Fix Status.IsClean() documentation
config: Add test for Windows local paths.
Signed-off-by: Jeremy Stribling <[email protected]>
Without reading the entire object into memory. Signed-off-by: Jeremy Stribling <[email protected]>
Suggested by taruti. Signed-off-by: Jeremy Stribling <[email protected]>
Signed-off-by: Máximo Cuadros <[email protected]>
Signed-off-by: Máximo Cuadros <[email protected]>
Use remote name in fetch while clone
…sk/go-git into bugfix/references-sort-timestamps
…e equal, test Signed-off-by: Máximo Cuadros <[email protected]>
references: sort: compare author timestamps when commit timestamps are equal. Fixes #725
Signed-off-by: Máximo Cuadros <[email protected]>
Signed-off-by: Máximo Cuadros <[email protected]>
Teach ResolveRevision how to look up annotated tags
Suggested by mcuadros. Issue: #982 Signed-off-by: Jeremy Stribling <[email protected]>
…ched length error Signed-off-by: Máximo Cuadros <[email protected]>
tree: add a Size() method for getting plaintext size
blame: fix edge case with missing \n in content length causing mismatched length error
Signed-off-by: Máximo Cuadros <[email protected]>
repository: allow open non-bare repositories as bare
repository: improve CheckoutOption.Hash doc
…support offset deltas
I think I have messed up the rebase/merge for this PR. I will close out this PR and submit a new one. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.