我怎样才能获得基于C语言的函数的diff? [英] How can I get c-function based diffs?

查看:173
本文介绍了我怎样才能获得基于C语言的函数的diff?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的团队使用SVN来管理我们的源代码。当在C文件执行重新因子,我偶尔既改变功能和文件内移动它们。一般来说,我尽量避免移动的功能,因为它使默认的svn差异变得有点怪僻这是怎么回事,并经常提供差异这是更混乱比它需要。

Our team uses svn to manage our source. When performing a re-factor on a C file, I occasionally both change functions and move them within the file. Generally I try to avoid moving functions, because it makes the default svn diff get a bit addled about what's going on, and it often provides a diff which is more confusing than it needs to be.

尽管如此,偶尔我做的都做功能的文件位置的变化,内部功能code的变化。这个出现的另一个地方是在分支合并,当文件发生冲突,其中一个或两个分支纷纷出招,以及内部功能的改变。

None the less, occasionally I do make both function file-location changes, and function internal code changes. Another place this comes up is in branch merging, when the file is in conflict, and either or both branches have moves as well as intra-function changes.

所以,我在找的是一个语义知道的diff工具,它可以告诉我的diff在两个层面 - 功能布局和细节(内部功能)。我尝试使用-p选项把分差(-x -p使用svn差异),但是这不是它的目标用户,它肯定没有做什么,我想要的。

So, what I am looking for is a semantically aware diff tool that could tell me diffs at two levels - function arrangement, and detail (intra-function). I tried using the "-p" option to diff (-x -p to svn diff), but that's not what it's intended for, it certainly didn't do what I wanted.

我只是想使用专门赶code-复制,如大学可能用于检查作业,但没有明显的快速搜索想出了。

Another option I just thought of is using a diff program designed to catch code-copying such as a university might use for checking assignments, but nothing obvious came up in a quick search.

推荐答案

你有工具来做到这一点的方法之一是首先移动功能,检查他们,然后改变他们。或有两个征募,当你看到这种情况发生在一个移动它们,SVN了对方,解决合并的问题。它移动的工作给你,但是让code评论更容易。

One way to do it with the tools you have is to move the functions first, check them in, then change them. Or have two enlistments, and when you see this happening move them in one, svn up the other, resolve the merge issue. It moves the work to you, but makes code reviews easier.

这篇关于我怎样才能获得基于C语言的函数的diff?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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