quilt-dev
[Top][All Lists]
Advanced

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

Re: [Quilt-dev] quilt new overrides SUBDIR


From: Joe Green
Subject: Re: [Quilt-dev] quilt new overrides SUBDIR
Date: Mon, 12 Jul 2004 21:00:37 -0700
User-agent: Mozilla Thunderbird 0.6 (Windows/20040502)

Andreas Gruenbacher wrote:
On Monday 12 July 2004 18:13, Joe Green wrote:
How about something like the attached patch?  It assumes that if both
the QUILT_PATCHES directory and the SERIES file have been found, the
SUBDIR value can be trusted.  Otherwise it generates an error, and the
user must specify "-f" to create a new root in the current directory.
This seems like it should be reliable, unless maybe QUILT_SERIES is set
to an absolute path.

The series file may also be in the QUILT_PATCHES directory, and this is often useful, too.

I agree, that's where I usually put it, but the patch doesn't assume or exclude any particular location for the series file. It uses the value of the SERIES variable.

It simply requires that the SERIES file already exist, so it wouldn't work until the first patch is created. I think it's reasonable that the first patch be created in the actual root directory, especially if new warns you it's going to do that and makes you specify "-f".

So checking for both doesn't give a lot more confidence about the directory to choose.

Using the default names, it means you've located an existing directory with the name "patches", and an existing file named "series" either in that directory, or in the parent directory of "patches", or in a ".pc" directory in the parent directory of "patches". That seems reasonably unlikely to occur outside of a quilt tree.

Unless you want to support creating a new root directory when you're already in a quilt tree?

It could require that the QUILT_PC directory be present as well. That seems like overkill to me, and it wouldn't work until the first patch is applied (as opposed to created), but that would still cover the great majority of uses.

I really wanted to avoid creating patches with `quilt new' above the current directory in the default case.

When you're down deep in a directory tree, it's nice to be able to do "new", "edit" and "refresh" on a file right there without having to go back to the top of the tree.

Since "new" is one of the only commands that doesn't honor SUBDIR, I think users will be surprised when it creates a new root in this situation; I was.

> How does an option sound that turns off this
check, and accepts the next higher-level patches directory it finds? (I'm thinking about a long option, e.g., --check-parent-dirs that people could add to quiltrc when needed.)

If you think it's safer to enable this only with an option, that's OK with me, since your recent changes have made it easy to turn this on in the quiltrc. I think it's a good idea to check for the existence of the SERIES file even if that option is given, though, and that seems to be safe enough for the option to be superfluous.

What do you think about making the users always specify "-f" for the
first patch, to make sure they really want to create a new root in the
current directory?  That could be implemented with small modifications
to this patch.

Unfortunately this doesn't solve the problem.

No, that wasn't my intention. This was a separate suggestion that if the other checks fail (e.g. either QUILT_PATCHES or SERIES doesn't exist), you'd have to specify "-f", which would mean it's OK to create a new root in the current directory (overriding SUBDIR as it does now, if necessary). Basically, you'd have to specify "-f" for the first patch in a tree, in order to confirm that you want to start a new tree.

I am quite happy that quilt does not require and special setup steps, and I would prefer to keep it that way.

I didn't intend this as a setup step, more as a simple protection from having a new "patches", ".pc" and "series" created when that wasn't the intention.

The suggested the behavior would be:

  - You'd have to specify "new -f" or "import -f" to create the first
    patch, because no existing root can be located.

  - After that, "new" would be able to reliably locate the root and
    would work safely in subdirectories.

  - If "new" (or "import") ever got into a situation where it couldn't
    locate an existing root (with various checks to be sure it's the
    root), it would exit with an error saying what amounts to "If you
    wish to proceed, I'm going to create a new root in the current
    directory.  Specify -f if that's what you want."

Sorry if this is a bit long; I just wanted to explain my thinking clearly. I'm not trying to force this on you.

--
Joe Green <address@hidden>
MontaVista Software, Inc.





reply via email to

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