James Ruiz
James Ruiz

Reputation: 101

Duplicate file differences when creating a patch with TortoiseSVN

I have an already existing SVN checked-in branch.

Using TortoiseSVN:

  1. I used SVN Checkout to get the branch onto my local computer.
  2. I merged a few lines of code into existing projects
  3. I create new subfolders for the newly written code.
  4. I TortoiseSVN->Add all the files for my new directories and files.
  5. Finally, I go to TortoiseSVN->Create Patch and save the file as myChanges.patch.

When I open the patch, nearly all my differences per source file are listed 3-4 times each.

How can I avoid having duplicate entries in my diff file when I create my patches via TortoiseSVN?

Upvotes: 4

Views: 1705

Answers (2)

Tuukka Turto
Tuukka Turto

Reputation: 145

This is old question, but one I couldn't find answers.

I was having the same problem and found out that the problem was how I was creating patches. Steps to reproduce:

  • create new folder
  • add one or more files in the folder
  • create patch and select both folder and files in it to be included

However, if I create patch by only selecting folder, resulting patch file will contain all files in the folder. If I don't want to include all files, I select only individual files and skip the folder completely. Both ways result a patch file where files are included only once.

Upvotes: 7

James Ruiz
James Ruiz

Reputation: 101

After conversing with many of my peers, I realized that I wasn't the only one to encounter the issue. When I asked them how they got around it, they informed me that they hand-edit the diffs when it occurs for them.

So I wrote a simple GUI tool to do this for us, both the code and executable can be downloaded from GitHub: https://github.com/Kakarot/TortoiseDiffCleaner/releases

You drag and drop your .diff or .patch files onto the UI and it generates a clean version of each file without the duplicate entries.

Upvotes: 2

Related Questions