请参阅gitlab中submodule的提交差异 [英] see diff of commit on submodule in gitlab

查看:169
本文介绍了请参阅gitlab中submodule的提交差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gitlab版本7.3,当我使用正常的存储库时,它工作得很好。
但是,我在gitlab项目中添加了一个github子模块。
在我的回购中,我在提交和推送(git push --recurse-submodules = check)之后完成了工作,它完美地工作。

但是现在,我可以看到我在gitlab上的提交,但是当我使用chrome在我的gitlab上浏览它时,diff并不显示。
子模块外部的所有提交文件都可以很好地显示。
这是一个已知的问题吗?

我有什么需要做的另一种方式吗?

解决方案

这是一个已知的问题...关于Git本身。



今天,Git 2.11和它的新版本 git diff --submodule = diff




(图片来自什么是Git 2.11中的新功能< a>from Tim Pettersen






注意:只有Git 2.13(GitLab GUI),因为它刚刚在Git中发布。 Q2 2017)修复了该功能中的一个错误:

请参阅 commit 17b254c (2017年3月31日)作者: Stefan Beller( stefanbeller
(由 Junio C Hamano - gitster - commit 1776a71 ,2017年4月17日)



运行 git diff --submodule = diff 在子模块中有它自己的子模块有变化会得到错误:

 致命:坏对象。 




发生这种情况是因为我们没有正确初始化环境
其中diff在子模块中运行。

这意味着我们从设置环境变量的主进程继承环境。 (显然,我们设置了不在子模块中时设置的环境变量,即 .git 目录被链接)







注意:Git 2.14仍然会改进该命令 git diff --submodule = diff

请参阅提交5a52214 (2017年5月4日)作者: Stefan Beller( stefanbeller

(由 Junio C Hamano合并 - gitster - commit a531ecf ,2017年5月29日)


diff :为inline diff

递归嵌套子模块

fd47ae6 diff :teach diff 显示子模块与内嵌比较差异,2016-08-31,Git 2.11)



显示子模块的内联差异时,会自动将
递归嵌套子模块以及内嵌子模块差异。



I have a gitlab version 7.3 that is working totally fine when I work with normal repositories. However, I added a github submodule inside my gitlab project. On my repo, I did after commit and push ( git push --recurse-submodules=check ) and it worked perfectly.

But now, I can see my commit on gitlab, but the diff isnt displayed when I browse it on my gitlab with chrome. 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.

It was resolved today with Git 2.11 and its new git diff --submodule=diff:

(picture from "What is new in Git 2.11" from Tim Pettersen)

This is not available through GitLab GUI, since it just got released in Git.


Note: only Git 2.13 (Q2 2017) fixes a bug in that feature:

See commit 17b254c (31 Mar 2017) by Stefan Beller (stefanbeller).
(Merged by Junio C Hamano -- gitster -- in commit 1776a71, 17 Apr 2017)

Running git diff --submodule=diff in a submodule which has it's own submodules that have changes get the error:

fatal: bad object.

This happens, because we do not properly initialize the environment in which the diff is run in the submodule.
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, i.e. the .git directory is linked)


Note: Git 2.14 still improve that command "git diff --submodule=diff", which now recurses into nested submodules.

See commit 5a52214 (04 May 2017) by Stefan Beller (stefanbeller).
(Merged by Junio C Hamano -- gitster -- in commit a531ecf, 29 May 2017)

diff: recurse into nested submodules for inline 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.

When showing the inline diff for submodules, automatically recurse into nested submodules as well with inline submodule diffs.

这篇关于请参阅gitlab中submodule的提交差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆