gnu diff_将Windows版本的GNU Patch.exe与CVS和Diff文件一起使用

gnu diff

gnu diff

All this is likely old hat for *nix folks, but some Windows people might care.

对于* nix人士来说,所有这一切可能都是旧帽子,但是某些Windows人士可能会在意。

As you know I work on DasBlog and SourceForge uses CVS for Source Control.

如您所知,我在DasBlog工作, SourceForge使用CVS进行源代码管理。

If you want to get the LATEST source for DasBlog and compile it yourself on Windows:

如果要获取DasBlog的最新源代码并在Windows上自行编译,请执行以下操作:

  • Download TortoiseCVS and install it.

    下载并安装TortoiseCVS

  • Make a folder for DasBlog (C:\dev\dasblog) and right click on the folder and select "CVS Checkout"

    为DasBlog创建一个文件夹(C:\ dev \ dasblog),然后右键单击该文件夹,然后选择“ CVS Checkout”
  • In the CVSROOT text box, enter in this:

    在“ CVSROOT”文本框中,输入以下内容:

    In the CVSROOT text box, enter in this::pserver:anonymous@cvs.sourceforge.net:/cvsroot/dasblogce

    在CVSROOT文本框中,输入以下内容::pserver:anonymous@cvs.sourceforge.net:/ cvsroot / dasblogce

    and in the Module text box enter "

    然后在“模块”文本框中输入“

    source"

    来源

  • Hit OK. You'll get all of DasBlog.

    点击确定。 您将获得全部DasBlog。
  • There's a file called CreateDasBlogVdir.vbs that will setup DasBlog in IIS, etc. Then compiled and play.

    有一个名为CreateDasBlogVdir.vbs的文件,它将在IIS等中设置DasBlog。然后进行编译和播放。
  • NOTE: When you do this you are implicitly getting a label in source control called "HEAD." That's the latest stuff that Omar and I and the devs (and now you) run. If you don't want the latest unreleased stuff, go to the Revision Tab before you hit OK and select "Choose branch or tag" and enter in "dasblog-1-7-5016-2" to get the last released version.

    注意:执行此操作时,您将隐式在源代码管理中获得一个名为“ HEAD”的标签。 这是Omar和我以及开发人员(现在是您)运行的最新内容。 如果您不想要最新的未发布内容,请在单击“确定”之前转到“修订”选项卡,然后选择“选择分支或标记”,然后输入“ dasblog-1-7-5016-2”以获取最新发布的版本。

If you aren't a dev with check in privileges, but you want contribute a patched file:

如果您不是具有签入权限的开发人员,但您想贡献一个补丁文件:

  • Make your changes to you files locally. Note that with CVS you don't have to "reserve" a file for check out. Just make the change. The file's overlay indicator will change to tell you it's been edited.

    对本地文件进行更改。 请注意,使用CVS,您不必“保留”文件以进行检出。 只需进行更改即可。 文件的覆盖指示器将更改以告诉您已被编辑。

    Cvsmakepatch
  • Save the .patch file using the format <modifedfile>.patch and mail it to Omar or I. For example, if you're patching LoginBox.ascx.cs the patch should be LoginBox.ascx.cs.patch.

    使用<modifedfile> .patch格式保存.patch文件,并将其邮寄给Omar或I。例如,如果要修补LoginBox.ascx.cs,则修补程序应为LoginBox.ascx.cs.patch。

If you're me, and you want to apply a patch file: (or if you're not me and you just want to apply a standard DIFF/PATCH file on Windows without pulling your hair out)

如果您是我,并且想要应用修补程序文件:(或者,如果您不是我,而您只想在Windows上应用标准DIFF / PATCH文件,而无需费力)

  • Use Notepad2. Why? Because it's one better than Notepad.

    使用记事本2 。 为什么? 因为它比记事本更好。

  • Open the patch file in Notepad2 and revel in the fact that Notepad2 already has the syntax highlighting setup to help you visualize the patch differences.

    在Notepad2中打开补丁文件,发现Notepad2已经具有语法高亮显示设置来帮助您可视化补丁差异。

    Patchinnotepad2
  • Download the GNU version of Patch.exe for Windows and put it in your path (or in your C:\Utils, if you're me)

    下载适用于WindowsGNU版本的Patch.exe ,并将其放在您的路径中(或者,如果您是我,则放在C:\ Utils中)

  • Now, make a Patch.bat file that looks like this below:

    现在,做一个Patch.bat文件看起来像这样如下:

    Now, make a Patch.bat file that looks like this below:@echo off
    patch < %1
    pause

    现在,做一个Patch.bat文件看起来像这样如下:@echo关闭补丁<%1 暂停

  • Now, right click on the <modifiedfile>.patch file and click "Open With" and associate it with your new patch.bat (not the patch.exe)

    现在,右键单击<modifiedfile> .patch文件,然后单击“打开方式”,然后将其与新的patch.bat(而不是patch.exe)关联。

    Patchassociation
  • Now copy the <modifiedfile>.patch to the same folder as the original. Double click on the <modifiedfile>.patch and you'll get:

    现在,将<modifiedfile> .patch复制到原始文件夹。 双击<modifiedfile> .patch,您将获得:

    Goodpatch

Now you can use CVS on Windows and play with CVS patches/diffs, making and patching with ease and grace. Enjoy.

现在,您可以在Windows上使用CVS并玩CVS补丁/差异,轻松轻松地制作和打补丁。 请享用。

FYI, If you want to get deeper into DasBlog development and start including patches, you'll want to subscribe to the checkin mail for DasBlog's CVS so you'll know what's changing when.

仅供参考,如果您想更深入地了解DasBlog的开发并开始包含补丁程序,则需要订阅DasBlog CVS的签入邮件,这样您就知道何时发生了什么变化。

Now playing: Akon - Trouble Nobody

现在播放: Akon-麻烦没人了

翻译自: https://www.hanselman.com/blog/using-a-windows-version-of-gnu-patchexe-with-cvs-and-diff-files

gnu diff

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值