quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] preserving file list?


From: Tim Bird
Subject: Re: [Quilt-dev] preserving file list?
Date: Wed, 06 Feb 2008 16:37:31 -0800
User-agent: Thunderbird 2.0.0.6 (X11/20070926)

strongcofi wrote:
Hi,

Firstly thanks for developing "quilt". Its a great tool and
has helped me manage my patches better.

Is there a way to preserve the file-list associated with a
patch?

I don't know the answer to this, but I have something
that may help.


I typically tend to add ALL files of a subdir to a new patch,
before starting to do my changes (as I dont know what files
I will really be modifying _and_ I dont have to remember to
add each file to the patch before i make any change in it).

I often find myself editing a file, only to realize I haven't
add'ed it to the current patch.  I use the following script
I wrote (and some manual steps) to recover from this.

I call it 'qmistake'.  You can repeat this process for
multiple files, if needed.  Unfortunately, I'm not sure
if it works for files which have not been modified by
any patch.  In the source trees I work in, this is very
rare.

Anyway, I hope this is helpful.
 -- Tim

---
#!/bin/sh

if [ -z "$1" ] ; then
        echo "Usage: qmistake <file>"
        echo "Shows patches to a file relative to last patch affecting"
        echo "that file, or relative to a snapshot"
        echo
        echo "When using quilt, if you forget to add a file to the topmost"
        echo "patch, it is difficult to recover from.  This shows you the"
        echo "changes you have made.  You can recover with the following"
        echo "steps:"
        echo "  qmistake <modified-file>  >/tmp/temp.patch"
        echo "  patch -p1 -R </tmp/temp.patch"
        echo "  quilt add <modified-file>"
        echo "  patch -p1 </tmp/temp.patch"
        echo "  quilt refresh"
        exit 1
fi

last_patch=`quilt patches $1 | tail -n 1`
if [ ! -z ${last_patch} ] ; then
        quilt diff -z -P ${last_patch}
else
        quilt diff --snapshot
fi






reply via email to

[Prev in Thread] Current Thread [Next in Thread]