简体   繁体   English

参见gitlab中子模块上的提交差异

[英]see diff of commit on submodule in gitlab

I have a gitlab version 7.3 that is working totally fine when I work with normal repositories. 我有一个gitlab 7.3版,在使用普通存储库时可以正常工作。 However, I added a github submodule inside my gitlab project. 但是,我在gitlab项目中添加了一个github子模块。 On my repo, I did after commit and push ( git push --recurse-submodules=check ) and it worked perfectly. 在我的仓库中,我是在提交并推送之后执行的(git push --recurse-submodules = check),它运行良好。

But now, I can see my commit on gitlab, but the diff isnt displayed when I browse it on my gitlab with chrome. 但是现在,我可以在gitlab上看到我的提交了,但是当我使用chrome在我的gitlab上浏览它时,未显示差异。 All the commits on files outside the submodules are well displayed meanwhile. 同时,所有显示在子模块之外的文件的提交都将很好地显示。 Is that a known issue? 这是一个已知问题吗?

Do I have something to do another way? 我还有其他方法可以做吗?

It is a known issue... about Git itself. 这是一个有关Git本身的已知问题。

It was resolved today with Git 2.11 and its new git diff --submodule=diff : 今天它已通过Git 2.11及其新的git diff --submodule=diff

在此处输入图片说明 (picture from " What is new in Git 2.11 " from Tim Pettersen ) (图片来自Tim Pettersen的Git 2.11中的新增功能 ”)

This is not available through GitLab GUI, since it just got released in Git. 由于它刚在Git中发布,因此无法通过GitLab GUI使用。


Note: only Git 2.13 (Q2 2017) fixes a bug in that feature: 注意:只有Git 2.13(2017年第二季度)修复了该功能中的错误:

See commit 17b254c (31 Mar 2017) by Stefan Beller ( stefanbeller ) . 参见Stefan Beller( stefanbeller )的 commit 17b254c (2017年3月31日
(Merged by Junio C Hamano -- gitster -- in commit 1776a71 , 17 Apr 2017) (由Junio C gitster - gitstercommit 1776a71中合并 ,2017年4月17日)

Running git diff --submodule=diff in a submodule which has it's own submodules that have changes get the error: 在一个子模块中运行git diff --submodule=diff ,该子模块具有自己的子模块,这些子模块具有更改,将得到以下错误:

fatal: bad object.

This happens, because we do not properly initialize the environment in which the diff is run in the submodule. 发生这种情况是因为我们没有正确初始化在子模块中运行diff的环境。
That means we inherit the environment from the main process, which sets environment variables. 这意味着我们从设置环境变量的主过程中继承环境。 (Apparently we do set environment variables which we do not set when not in a submodules, ie the .git directory is linked) (显然,我们设置了不在子模块中时未设置的环境变量,即链接了.git目录)


Note: Git 2.14 still improve that command " git diff --submodule=diff ", which now recurses into nested submodules. 注意:Git 2.14仍然改进了命令“ git diff --submodule=diff ”,该命令现在递归到嵌套的子模块中。

See commit 5a52214 (04 May 2017) by Stefan Beller ( stefanbeller ) . 参见Stefan Beller( stefanbeller 提交5a52214 (2017年5月4日
(Merged by Junio C Hamano -- gitster -- in commit a531ecf , 29 May 2017) (由Junio C gitster - gitstercommit a531ecf中合并 ,2017年5月29日)

diff : recurse into nested submodules for inline diff diff :递归到内联diff的嵌套子模块中

When fd47ae6 ( diff : teach diff to display submodule difference with an inline diff, 2016-08-31, Git 2.11) was introduced, we did not think of recursing into nested submodules. 引入fd47ae6diff :教diff用内联diff显示子模块差异,2016-08-31,Git 2.11)时,我们没有想到要递归到嵌套子模块中。

When showing the inline diff for submodules, automatically recurse into nested submodules as well with inline submodule diffs. 当显示子模块的内联差异时,也会自动与内联子模块差异递归到嵌套子模块中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM