-
Notifications
You must be signed in to change notification settings - Fork 656
When using gitHub flow we don't need to Fetch other branches then master #85
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
Conversation
So in this case @sfarmar want to use GitHubFlow and in that case we don't need to fetch branches? I guess since we use the existence of "develop" branch as the thing enabling GHF we need to make the calls? Perhaps we can add a Mode=GHF switch/env/etc that allows users to avoid this? |
That is not true, you still need to fetch if you want pull request support to work Also tags are not fetched by default I don't think, so at a minimum we need to fetch tags |
Ah, got it. So the fix is to hope ssl support gets into lib2gitsharp? On Fri, Feb 21, 2014 at 8:33 AM, Jake Ginnivan [email protected]:
|
Ssl is supported AFAIK. |
@sfarmar can you add the exact config you used in TC that caused this? On Fri, Feb 21, 2014 at 10:28 AM, nulltoken [email protected]:
|
I'v worked around this by adding this build step (ps) Thanks @andreasohlund
|
@andreasohlund why did you close this?
Seem like we have some viable improvements here. |
Pretty sure this was a dupe but I was wrong. Reopened |
After talking to @nulltoken we have a proposed solution for this: Since lib2gitsharp supports a username /pwd we can modify: https://github.com/Particular/GitVersion/blob/master/GitFlowVersion/BuildServers/GitHelper.cs#L17 To check for the existence of 2 environment variables: GITVERSION_REMOTE_USERNAME if those are present we call the other overload to fetch that will then authenticate and be able to fetch the branches. Here is the doco for that overload: https://github.com/libgit2/libgit2sharp/blob/vNext/LibGit2Sharp.Tests/FetchFixture.cs#L52-L74 |
@andreasohlund Added what we discussed about. See the attached commit. |
When using gitHub flow we don't need to Fetch other branches then master
Can we have an environment configuration switch or argument to stop this error... (?)
[UpdateAssemblyInfo] GitFlowVersionTask.UpdateAssemblyInfo [18:06:08][GitFlowVersionTask.UpdateAssemblyInfo] Applicable build agent found: 'TeamCity'. [18:06:08][GitFlowVersionTask.UpdateAssemblyInfo] Executing PerformPreProcessingSteps for 'TeamCity'. [18:06:08][GitFlowVersionTask.UpdateAssemblyInfo] One remote found (origin -> 'https://[email protected]/Particular/Website.Backend.git'). [18:06:08][GitFlowVersionTask.UpdateAssemblyInfo] Fetching from remote 'origin' using the following refspecs: +refs/heads/*:refs/remotes/origin/*. [18:06:08] [GitFlowVersionTask.UpdateAssemblyInfo] Error occurred: LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Net (Error). Request failed with status code: 401 at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) at LibGit2Sharp.Core.Proxy.git_remote_connect(RemoteSafeHandle remote, GitDirection direction) at LibGit2Sharp.Network.DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options) at LibGit2Sharp.Network.Fetch(Remote remote, FetchOptions options) at GitFlowVersion.GitFlowVersion.GitHelper.NormalizeGitDirectory(String gitDirectory) in c:\BuildAgent\work\5e0d79a4e3943b17\GitFlowVersion\BuildServers\GitHelper.cs:line 17 at GitFlowVersion.TeamCity.PerformPreProcessingSteps(String gitDirectory) in c:\BuildAgent\work\5e0d79a4e3943b17\GitFlowVersion\BuildServers\TeamCity.cs:line 20 at GitFlowVersionTask.UpdateAssemblyInfo.InnerExecute() in c:\BuildAgent\work\5e0d79a4e3943b17\GitFlowVersionTask\UpdateAssemblyInfo.cs:line 85 at GitFlowVersionTask.UpdateAssemblyInfo.Execute() in c:\BuildAgent\work\5e0d79a4e3943b17\GitFlowVersionTask\UpdateAssemblyInfo.cs:line 43