Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 6/9] vcs_info quilt: fix unapplied detection on sub-directory



On Sun, Sep 14, 2014 at 11:47:55AM +0200, Frank Terbeck wrote:
> Marc Finet wrote:
> > When being in a subdirectory of a "repo" being handled with quilt,
> > the `quilt unapplied` command returns all the patches because
> > QUILT_PATCHES is an absolute path (which exists and is a dir) and
> > quilt considers that .pc should in current directory.
> > Changing quilt might be overkill and it seems that QUILT_PATCHES
> > should just be a name, not an absolute path.
> [...]
> > -        unapplied=( ${(f)"$(QUILT_PATCHES=$patches $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} )
> > +        unapplied=( ${(f)"$(QUILT_PATCHES=$(basename $patches) $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} )
> 
> 
> You can't do it like this. With debian-packages for example, quilt
> patches live in ‘debian/patches’, which the ‘basename’ call would trim
> down to ‘patches’.
> 
> If you do need special QUILT_PATCHES treatment, you can set a
> ‘quit-patches-dir’ style; if the treatment needs to be fancy, you can
> also set the style to a function, which opens up the door to whatever
> you like.
Hum, in fact this commit was intented to 'fix' such the debian/ behavior
but miserably failed. I tested different settings and here are my results;
for debian patches, the working tree is as follows:
  work/
  ├── debian/
  │    ├── patches/
  │    │     ├── series         (list of patches to apply)
  │    │     ├── patch1.diff    (one particular patch)
  │    │     ├── patch2.diff
  │    │     └── ...
  │    └── ...
  ├── .pc/
  │    ├── .quilt_patches (content of QUILT_PATCHES)
  │    ├── .quilt_series  (content of QUILT_SERIES)
  │    ├── patch1.diff/   (copy of patched files)
  │    │    └── ...
  │    ├── patch2.diff/
  │    │    └── ...
  │    └── ...
  └── ...
But:
  - 1) without setting QUILT_PATCHES nor quilt-patch-dir:
     - quilt is not detected in work/
     - quilt is detected in work/anything/ but reports all patches
       as both applied and unapplied (%a/%p gives x/2x)
     - `quilt` does not work if no .pc/ exists
  - 2) with QUILT_PATCHES set to "debian":
     - quilt is detected everywhere and reports correct patches
       numbers
     - but `quilt` stops to work (e.g. `quilt series` shows only
       latest patch, `quilt pop` fails)
  - 3) with QUILT_PATCHES set to "debian/patches":
     - quilt is detected in work/
     - quilt is detected in work/anything/ but reports all patches
       as both applied and unapplied (%a/%p gives x/2x)
     - `quilt` works when no .pc/ exists
  - 4) with quilt-patch-dir set to "debian"
     - quilt is correctly detected everywhere
     - but unapplied patches are not detected (due to missing /patches when
       setting QUILT_PATCHES on quilt unapplied invocation)
     - but `quilt` does not work if no .pc/ exists
  - 5) with quilt-patch-dir set to "debian/patches":
     - quilt is detected in work/
     - quilt is detect in work/anything/ but reports all patches
       as both applied and unapplied (%a/%p gives x/2x)

So I do not understand the role of quilt-patch-dir as for me it takes
the role of QUILT_PATCHES except the missing '/patches'. Moreover changing
to sub-directory in cases 1, 3 and 5 makes applied patch detection failing
because:
 - applied is patch1.diff patch2.diff ...
 - unapplied is /path/to/work/debian/patches/patch1.diff ...

For me $patches should have the QUILT_PATCHES semantic, i.e. include the
/patches at end (as said in man page). If you agree with this analysis, i
might find a patch to make cases 3 and 5 working (even if it breaks the
quite-working case 4). And re-reading the man page gives me a hint for the
quilt-patch-dir usage: configure QUILT_PATCHES (with hook) per repository
with zstyle ?

Marc



Messages sorted by: Reverse Date, Date, Thread, Author