Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I run the following command, it doesn't seem to be ignoring what I specify in the ignore.txt file. I have tried adding some of the arguments with -x, but there are way too many to do that by hand.

This is the command I ran:

diff -rcP -X ignore.txt linux-3.10.10 projfolder > submission/patchfile.diff

The diff file that is created includes things that were supposed to be ignored. Does anyone know what may be happening? Am I just using diff incorrectly?

Example of what's in the ignore.txt:

share|improve this question
Could you include a minimal example? What is in the file? Or are these directories (they should be)? What is supposed to be ignored? What is your output and what should it have been? – terdon Sep 11 '13 at 19:47
up vote 0 down vote accepted

Turns out the problem was with the character encoding. For some reason it had carriage return line feeds. I'm not sure why this happened in the first place since none were actually put in the file. But I ran:

dos2unix ignore.txt

And ran diff again and it seemed to work fine.

share|improve this answer
Using diff (GNU diffutils) 3.2 on my system, this makes no difference, either format works correctly. – michael_n Sep 17 '13 at 8:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .