[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] How is one supposed to use guards(1) alongside quilt(1)?
From: |
Oleksandr Gavenko |
Subject: |
Re: [Quilt-dev] How is one supposed to use guards(1) alongside quilt(1)? |
Date: |
Sun, 28 Feb 2021 01:48:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (cygwin) |
On 2021-02-12, Xavier Morel via Quilt-dev wrote:
> Does quilt(1) have some sort of integration so guards(1) is automatically
> applied before quilt(1)
> looks at the series file, or does guards(1) have to be explicitely applied to
> a
> series-file-with-guards in order to generate series files, with new patches
> then having to be
> copied manually to the "reference" file with guards? Or some other way I did
> not think of?
I checked sources: quilt command delegates work to scripts under internally
defined QUILT_DIR and prints every available script names if you run quilt
without arguments:
Commands are:
add fold new remove top
annotate fork next rename unapplied
applied graph patches revert upgrade
delete grep pop series
diff header previous setup
edit import push snapshot
files mail refresh switch
There is no guards. Also there are no occurrences in Git sources:
git clone https://git.savannah.nongnu.org/git/quilt.git
cd quilt
grep -R guards quilt/
So you have to use guards(1) as standalone app, there is no integration.
> The guards(1) utility is packaged as part of the quilt distribution, but it's
> a bit unclear how it's
> supposed to be used, possibly more so because I have experience with
> Mercurial's `mq` where guards
> are supported natively. I have looked at the man pages, but didn't find
> explanations of using the two together, and while the README
I haven't heard about "hg qguard" until now. I actively used hg mq but
nowadays Git is widespread and I started to use quilt instead of MQ.
As for guard there is an open question:
https://stackoverflow.com/questions/65934503/how-do-you-use-guards1-with-quilt1
and the utility has been bundled since 2003...
To familiarize with the concept I tried the guards:
# mkdir patches
# touch patches/first.patch
# touch patches/second.patch
# printf -- "first.patch\n" | guards --check --prefix=patches
Unused: second.patch
# printf -- "first.patch\n" | guards --prefix=patches
patches/first.patch
# printf -- "+ok first.patch\n" | guards --check --prefix=patches ok
Unused: second.patch
# printf -- "+ok first.patch\n" | guards --prefix=patches ok
patches/first.patch
# printf -- "+ok first.patch\n" | guards --prefix=patches fail
# printf -- "+ok first.patch\n-fail second.patch\n" | guards --check
--prefix=patches ok fail
# printf -- "+ok first.patch\n-fail second.patch\n" | guards --prefix=patches
ok fail
patches/first.patch
# printf -- "+ok first.patch\n-fail second.patch\nthird.patch\n" | guards
--check --prefix=patches ok fail
Not found: patches/third.patch
# printf -- "+ok first.patch\n-fail second.patch\nthird.patch\n" | guards
--prefix=patches ok fail
patches/first.patch
patches/third.patch
So guards(1) is preprocessor for config file following syntax:
+xxx Include the file(s) on this line if the symbol xxx is defined.
-xxx Exclude the file(s) on this line if the symbol xxx is defined.
+!xxx Include the file(s) on this line if the symbol xxx is not defined.
-!xxx Exclude the file(s) on this line if the symbol xxx is not defined.
with option to find orphan or missing files to generate series file.
I think there should be integration of quilt and guards. Like storing
currently selected guards in .pc directory and overall replicate HG MQ CLI.
--
http://defun.work/