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
Trying to fetch all tags fails #927
Conversation
@hendrikmaarand Thanks a lot for raising this! Just a quick request: Could you please also add the complete exception stack traces regarding the failures? |
Stack trace for the first one:
For the second one:
|
@hendrikmaarand Great! Could you please also include the exception messages? |
@nulltoken Updated! |
Hmmm. I can't repro against the latest vNext. The following test pass [Fact]
public void Issue_927()
{
var scd = BuildSelfCleaningDirectory();
string clonedRepoPath = Repository.Clone("https://github.com/haskell/haskell-mode.git", scd.DirectoryPath);
using (var repo = new Repository(clonedRepoPath))
{
var sig = new Signature("hendrik", "hendrik@somemail.ee", new DateTimeOffset());
repo.Network.Pull(sig, new PullOptions());
repo.Network.Pull(sig,
new PullOptions { FetchOptions = new FetchOptions { TagFetchMode = TagFetchMode.All } });
repo.Fetch("origin", new FetchOptions { TagFetchMode = TagFetchMode.All });
}
} Can you confirm? If you're not willing to build the source code by yourself, you could download a prerelase NuGet package from https://ci.appveyor.com/project/libgit2/libgit2sharp/build/0.20.2.127/job/b74exootjw18apt2/artifacts and check your code against this new version (this will require you to add a new local NuGet source). Please, do not use this package in production 😉 |
Confirmed repro in v0.20.2 |
Thanks a lot for this report... and sorry for the inconvenience 😕 Will be fixed as part of v0.21 (which should be released shortly). |
[InlineData(TagFetchMode.All, 4)] | ||
[InlineData(TagFetchMode.None, 0)] | ||
[InlineData(TagFetchMode.Auto, 3)] | ||
//[InlineData(TagFetchMode.Auto, 3)] // TODO: Skipping due to github modification of --include-tag handling." |
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.
@carlosmn git fetch
against a newly initialized repository with the following config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = https://github.com/libgit2/TestGitRepository
fetch = +refs/heads/*:refs/remotes/origin/*
outputs
$ git fetch
remote: Counting objects: 68, done.
remote: Total 68 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (68/68), done.
From https://github.com/libgit2/TestGitRepository
* [new branch] first-merge -> origin/first-merge
* [new branch] master -> origin/master
* [new branch] no-parent -> origin/no-parent
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 1 (delta 0)
Unpacking objects: 100% (1/1), done.
* [new tag] annotated_tag -> annotated_tag
* [new tag] blob -> blob
* [new tag] commit_tree -> commit_tree
Aren't we missing something in the way we handle the auto
mode?
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.
git is noticing that the server did not automatically send the tags and is performing a second fetch. This second fetch is completely different from the first one, so atm I don't think libgit2 should emulate that behaviour since we implement the underlying functionality, not the UI git wants to provide.
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.
I think so - or at least a way to have it fetch with "expected" behavior. If someone wanted the "underlying functionality" behavior, maybe we could expose that as an advanced method.
As a writer of an application calling into lg2#'s fetch, I would expect for it to fetch tags (and not have to handle that in my application).
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.
Created #936 to keep track of this.
@hendrikmaarand I've transmuted this issue into a Pull Request with additional test coverage. |
Trying to fetch all tags fails
Related to this: http://stackoverflow.com/questions/28091482/how-to-pull-all-new-tags-using-libgit2sharp
Essentially I would like to use libgit2sharp to achieve 'git pull --tags'
I am using libgit2sharp 0.20.2
Here is a sample which fails for me: