Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

*build*
*drivers*
*scripts*
*sound*
.tmp_*
..tmp_*
.config*
*.o
*.ko
*.cmd
*.mod.c
*vmlinux*
.kconf*
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.