Hi Jerome, On 2005-08-10, Jerome Lacoste wrote: > I am having problems to generate a patch with a new empty file. > > Here's a test case that exhibits the problem in quilt. > The message "Nothing in patch test.diff" is was gets printed instead > of "Refreshed..." > > $ mkdir -p d/patches > $ cd d > > $ quilt new test.diff > > Patch test.diff is now on top > $ quilt add file.txt > > File file.txt added to patch test.diff > $ touch file.txt > $ quilt refresh > > Refreshed patch test.diff > > # $ quilt diff > > $ cd .. > $ rm -rf d > > The problem lies in the inability for diff to generate a diff for new > empty files (used in diff_file in patchfns): > > rm file.txt > touch file.txt > diff /dev/null file.txt > > produces nothing. > > Any idea?
As you found out, this is caused by a limitations in diff (or more precisely, in the diff output format, which is even worse). As long as quilt uses diff to generate patch files, there's anything we can do. The core concept of quilt is that you manipulate the changes made to a source tree in the form of patches generated by diff and that can be applied using patch, so only information that can possibly be stored in diff output files can be handled by quilt. The only way to change that would be to change the format used by quilt to store the information. The new format would need to have the ability to differenciate between no file and an empty file. However, I doubt anyone really wants to change that aspect of quilt, as no other "difference between files" format is as flexible and as supported as unified or context diffs. Why do you want so hard to manipulate empty files? This is usually never really needed. Can you explain your case? Maybe you can simply add a single new line character to the file in question and it'll solve your problem. -- Jean Delvare _______________________________________________ Quilt-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/quilt-dev
