首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我如何获得git-指责和日志来忽略行包装更改?

我如何获得git-指责和日志来忽略行包装更改?
EN

Stack Overflow用户
提问于 2011-10-23 07:07:21
回答 2查看 581关注 0票数 2

我想要一个更改日志,以及一个忽略行包装中的更改的责备注释。例如..。

代码语言:javascript
复制
-This is the hardest part of testing, where do you start?  People often
-get overwhelmed at the apparent enormity of the task of testing a
-whole module.  Best place to start is at the beginning.  Date::ICal is
-an object-oriented module, and that means you start by making an
-object.  So we test C<new()>.
+This is the hardest part of testing, where do you start?  People often get
+overwhelmed at the apparent enormity of the task of testing a whole module.
+The best place to start is at the beginning.  C<Date::ICal> is an
+object-oriented module, and that means you start by making an object.  Test
+C<new()>.

那里几乎没有什么内容改变,但是日志和指责会显示出一切都变了。这既使修补程序难以检查,也阻碍了检查代码使用时间的工具。

-w是不够的。

更新:我得到了一半的答案:git log -p --word-diff覆盖日志记录。

EN

回答 2

Stack Overflow用户

发布于 2011-10-23 07:17:37

你就得自己写工具了。默认情况下,在Git中使用的diff工具(以及其他大多数的diff工具)可以进行逐行的差分,这将无法实现您想要的结果。

票数 0
EN

Stack Overflow用户

发布于 2011-10-23 08:32:34

由于gitv1.4.3可以使用diff选项--color-words显示内联更改,而忽略换行符,例如:

代码语言:javascript
复制
git log -p --color-words

由于GIT1.7.2有一个更通用的--word-diff选项,它也可以输出类似的内联差异,但是用纯文本而不是用颜色标记差异。

据我所知,您不能用git blame做任何这样的事情。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7864843

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档