git-extensions:补丁不应用,错误代码100644

发布于 01-18 02:38 字数 2933 浏览 4 评论 0原文

我正在研究C#项目,我的版本控制系统基于GIT,我想使用Git-Extensions在软件中检查一些较小的更改,并使用“阶段选择的行”。我以前做过,它运行良好。但是,现在,我在Message Box中收到错误消息“未应用”。

我看到两个可能的问题:

  1. 小变化本身有问题。
  2. 整个文件都出了点问题(错误代码100644)。

1._进行小变化。

在此上,一些典型的示例(在一种情况下,我只是尝试在第二行(绿色)行上演,第二个我尝试上演新(绿色)和已删除的(红色)行:

示例1:

---------------------------
Error
---------------------------
error: patch failed: <Directory>/Filename.cs:105
error: <Directory>/Filename.cs: patch does not apply


diff --git a/<Directory>/Filename.cs b/<Directory>/Filename.cs
index 8947eb9..8be5ca9 100644
--- a/<Directory>/Filename.cs
+++ b/<Directory>/Filename.cs
@@ -105,14 +105,15 @@
                 {
                     using (var database = ...())
                     {
                         log.Debug($"Information recognised ...");
+                        log.Trace($"Information recognised ...");
                         ...
--
Git Extensions 3.5.4.12724
---------------------------
OK   
---------------------------

示例2:示例2:

---------------------------
Error
---------------------------
error: patch failed: <Directory>/Filename.cs:105
error: <Directory>/Filename.cs: patch does not apply


diff --git a/<Directory>/Filename.cs b/<Directory>/Filename.cs
index 8947eb9..8be5ca9 100644
--- a/<Directory>/Filename.cs
+++ b/<Directory>/Filename.cs
@@ -105,14 +105,14 @@
                 {
                     using (var database = ...())
                     {
-                        log.Debug($"Information recognised ...");
+                        log.Trace($"Information recognised ...");
                         ...
--
Git Extensions 3.5.4.12724
---------------------------
OK   
---------------------------

如您所见,您可以看到,我试图通过log.debug log.trace以获取

您的信息 。

。一直

存在 是结果:

-rwxrwxrwx 1 scampsd scampsd 42034 Mar 29 15:26 Filename.cs
drwxrwxrwx 1 scampsd scampsd  4096 Mar 29 15:26 .

该目录中的其他文件相似。

用于在我的Windows-10计算机上显示目录/文件权限的应用程序,这 br> 我正在使用git-extensions作为交互式Windows工具,我不熟悉Commandline git。

编辑1:
我刚刚尝试了chmod 644 filename.cs,但是文件权限表示相等。

edit2:
我没有使用我的WSL Ubuntu,而是使用git bash询问ls -ltra,这是结果:

-rw-r--r-- 1 DDM 1049089 42034 Mar 29 15:26 Filename.cs
drwxr-xr-x 1 DDM 1049089     0 Mar 29 15:26 ./

在此结果:我尝试上演整个文件,并且效果很好。

edit3:
根据答案,这个超级用户问题,我已经启动了:

stat -c '%a' Filename.cs
644

因此,errorcode 100644意味着,意味着文件的属性是100644,它是错误的,但我不知道应该是什么。

edit4:
git版本:

$ git --version
git version 2.31.1.windows.1

I'm working on a C# project, my versioning system is based on GIT and I would like to check in some minor changes in my software using GIT-extensions, using "Stage selected line(s)". I have done this before and it was working fine. Now, however, I'm getting the error message "patch does not apply" in a messagebox.

I see two possible problems:

  1. either something's wrong with the small change itself.
  2. either something's wrong with the entire file (investigation of error code 100644).

1._Investigation of the small change.

Hereby some typical examples (in one case I just try to stage the new (green) line, in the second I try to stage the new (green) and the deleted (red) line:

Example1:

---------------------------
Error
---------------------------
error: patch failed: <Directory>/Filename.cs:105
error: <Directory>/Filename.cs: patch does not apply


diff --git a/<Directory>/Filename.cs b/<Directory>/Filename.cs
index 8947eb9..8be5ca9 100644
--- a/<Directory>/Filename.cs
+++ b/<Directory>/Filename.cs
@@ -105,14 +105,15 @@
                 {
                     using (var database = ...())
                     {
                         log.Debug(
quot;Information recognised ...");
+                        log.Trace(
quot;Information recognised ...");
                         ...
--
Git Extensions 3.5.4.12724
---------------------------
OK   
---------------------------

Example 2:

---------------------------
Error
---------------------------
error: patch failed: <Directory>/Filename.cs:105
error: <Directory>/Filename.cs: patch does not apply


diff --git a/<Directory>/Filename.cs b/<Directory>/Filename.cs
index 8947eb9..8be5ca9 100644
--- a/<Directory>/Filename.cs
+++ b/<Directory>/Filename.cs
@@ -105,14 +105,14 @@
                 {
                     using (var database = ...())
                     {
-                        log.Debug(
quot;Information recognised ...");
+                        log.Trace(
quot;Information recognised ...");
                         ...
--
Git Extensions 3.5.4.12724
---------------------------
OK   
---------------------------

As you can see, I'm trying to replace log.Debug by log.Trace.

For your information, I have also tried to do the same thing on larger parts of code, but the problem persists.

2._Investigation of the entire file

As far as the "errorcode" is concerned (100644): according to some Google search results this is related to file permissions, which are not very straightforward in Windows, so I have used my Ubuntu WSL app for showing directory/file permissions on my Windows-10 computer, this is the result:

-rwxrwxrwx 1 scampsd scampsd 42034 Mar 29 15:26 Filename.cs
drwxrwxrwx 1 scampsd scampsd  4096 Mar 29 15:26 .

Those results are similar for other files in that directory. I have no idea if this is correct or not.

Does anybody know what I can do?
I'm using GIT-extensions as an interactive Windows tool, I'm not familiar with commandline GIT.

Edit 1:
I have just tried chmod 644 Filename.cs, but the file permissions say equal.

Edit2:
Instead of using my WSL Ubuntu, I asked ls -ltra using GIT bash, this the result:

-rw-r--r-- 1 DDM 1049089 42034 Mar 29 15:26 Filename.cs
drwxr-xr-x 1 DDM 1049089     0 Mar 29 15:26 ./

In top of this, I tried to stage the entire file, and that worked fine.

Edit3:
According to the answer on this Superuser question, I have launched:

stat -c '%a' Filename.cs
644

So, the errorcode 100644 means that the file's properties are 100644 which are somewhere wrong, but I have no idea what it should be instead.

Edit4:
Git version:

$ git --version
git version 2.31.1.windows.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文