On Thu, 14 May 2020 11:41:23 +0200, Jean Delvare wrote: > OK, I worked on this and came up with two options how this can be fixed. > > Option #1: Fix the "series" command so that it reports "No series file > found" if not in a quilt-managed tree. This is essentially your patch > fixed up to not introduce regressions and extended to the non-verbose > case. > > Pros: No side effects. > Cons: The code is kind of quirky, and it duplicates the error message. > That can be addressed subsequently (I have code for it already), but > that makes the code even more quirky. Also, similar changes would be > needed for the "pop" and "snapshot" commands (I don't have code for > that yet). > > Option #2: Check for the presence of a series file early for all quilt > commands (except a handful) before doing anything else. > > Pros: This guarantees consistency across all commands by design, and > fixes the "pop" and "snapshot" commands. The code is neat, one error > message is de-duplicated. Functions find_first_patch and > find_last_patch are simplified, which should compensate for the time > spent in the initial presence check. > Cons: This approach has a side effect on the value returned by the > "pop", "push", "top" and "next" commands when run outside of a quilt- > managed tree. So far, they would return 2 in that case (same as when > trying to pop when you have no patch applied, or trying to push when > all patches are already applied). After this change, they would return > 1 instead (plain error).
For the record, I went with option #2, committed this morning. -- Jean Delvare SUSE L3 Support _______________________________________________ Quilt-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/quilt-dev
