我正在研究一个项目并且我提交了我的第一个拉取请求,而我正在等待的时候,我想继续处理我的项目,从我合作的工作中积累起来,这仍然悬而未决.现在我有:
*master
user_story_1
Run Code Online (Sandbox Code Playgroud)
user_story_1 有拉开请求.
现在我正在尝试创建一个新的分支user_story_2,我可以继续我离开的工作user_story_1.如何在Git中执行此操作而不会遇到任何冲突或影响我的挂起合并?
我们正在构建一个高度并发的Web应用程序,最近我们已经开始广泛使用异步编程(使用TPL和async/ await).
我们有一个分布式环境,其中应用程序通过REST API(构建在ASP.NET Web API之上)相互通信.在一个特定的应用程序中,我们DelegatingHandler在调用之后base.SendAsync(即,在计算响应之后)将响应记录到文件中.我们在日志中包含响应的基本信息(状态代码,标题和内容):
public static string SerializeResponse(HttpResponseMessage response)
{
var builder = new StringBuilder();
var content = ReadContentAsString(response.Content);
builder.AppendFormat("HTTP/{0} {1:d} {1}", response.Version.ToString(2), response.StatusCode);
builder.AppendLine();
builder.Append(response.Headers);
if (!string.IsNullOrWhiteSpace(content))
{
builder.Append(response.Content.Headers);
builder.AppendLine();
builder.AppendLine(Beautified(content));
}
return builder.ToString();
}
private static string ReadContentAsString(HttpContent content)
{
return content == null ? null : content.ReadAsStringAsync().Result;
}
Run Code Online (Sandbox Code Playgroud)
问题是:当代码达到content.ReadAsStringAsync().Result大量服务器负载时,请求有时会挂起在IIS上.当它发生时,它有时会返回一个响应 - 但它会挂起在IIS上,就像它没有 - 或者在其他时候它永远不会返回.
我也尝试过阅读内容ReadAsByteArrayAsync,然后将其转换为内容String,没有运气.
当我将代码转换为使用异步时,我甚至得到更奇怪的结果:
public static async Task<string> SerializeResponseAsync(HttpResponseMessage response)
{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试按照此处描述的步骤实现HTTP方法覆盖.基本上,我正在创建一个DelegatingHandler,类似于以下内容,并将其添加为消息处理程序Application_Start.
public class MethodOverrideHandler : DelegatingHandler
{
readonly string[] _methods = { "DELETE", "HEAD", "PUT" };
const string _header = "X-HTTP-Method-Override";
protected override Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
// Check for HTTP POST with the X-HTTP-Method-Override header.
if (request.Method == HttpMethod.Post && request.Headers.Contains(_header))
{
// Check if the header value is in our methods list.
var method = request.Headers.GetValues(_header).FirstOrDefault();
if (_methods.Contains(method, StringComparer.InvariantCultureIgnoreCase))
{
// Change the request method.
request.Method = new HttpMethod(method);
}
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试连接到通过我的VPN工作的存储库.我下载了Git,当我尝试克隆回购时,我收到此消息:
Unable to negotiate with XX.XX.XXX.XXX : no matching host key type found . their offer: ssh-dss
有什么我想念的吗?
我发现自己做git log --oneline往往得到一个快速浏览一下改变我即将推到或合并从遥控器.是否可以附加一些标识符(例如"[...]")来将该提交消息标记为多行标识,因此我可以知道那里有更多信息?
基本上,我想要的是这样的:
e1140de Some commit message
d1f58d1 Some multine commit message [...]
736f778 Some other commit message
Run Code Online (Sandbox Code Playgroud) git ×3
c# ×2
async-await ×1
c#-5.0 ×1
css ×1
git-log ×1
html ×1
httpcontent ×1
pull-request ×1
repository ×1
ssh ×1
vpn ×1