diff -uNr a/vcodectrl/README b/vcodectrl/README --- a/vcodectrl/README false +++ b/vcodectrl/README c5945047c06690b50f3fd33b8b4c44297184580d2dd4afdc07ed9a09b385dcd0005fb64a33c509cbd1b1504ab6a34824e822a663745538176bd76c103a98adc5 @@ -0,0 +1,46 @@ +Feb, 2020 +Diana Coman + +This is a very basic set of scripts for automating the vpatch creation given an existing code base. It's meant for local & development use ie it's not aiming for robustness and not even for a publishable V-tree directly (though it can certainly be used for that if desired) but for convenience at maintaining a record of ongoing work as well as the means to rollback any work to a previous point and/or branch off on exploratory changes. +Prerequisites: vdiff, gpg (with secret key for the user set in v_init.sh). +NB: DO change in BOTH scripts the name to match the gpg key you want used by the script! +NB: the scripts are blind beasts and don't check anything but plow on, so unless you want to obtain garbage: a. know what you're doing and run them in the correct order b. don't mess up their expectations (esp the contents of the a b directories). + +There are 2 basic scripts: +v_init.sh - to be run only once, at the very beginning; this creates and populates correctly (with the newly made genesis vpatch + corresponding sig that it creates) the directories a, b, patches, .seals and .wot. +v_commit.sh - this assumes that all directories are in place already (esp a, b, patches, .seals, .wot) and that b contains the result of a *previous* press on which the new .vpatch is to be created. + + +Usage: +1. To genesis some code: +from the directory of your choice, run the v_init.sh script giving it as parameters: the name of the project (it will be used to name the genesis as projectName_genesis.vpatch), the name of the directory containing the code you want under control (if it's not local, you'll have to give the full path) and, optional, any number of files that are not in the directory previously given but you want included as well (usually this is manifest and possibly a .gpr file for my use) + +Example: +sh v_init.sh vcodectrl vcode manifest + +2. To pack current changes to the code into a new .vpatch on top of whatever is currently found in the b directory: +from the directory containing the a,b,patches,.seals,.wot, run the v_commit.sh script giving it as parameters: the name of the project, the name of the directory containing the code, the name for the new vpatch (without the extension so without .vpatch at the end) and, optional, any number of files that are not in the directory previously given but you want included as well (usually this is manifest and possibly a .gpr file for my use). + +Example: +sh v_commit.sh vcodectrl vcode added_readme manifest README + +3. To check the result: +simply use your favourite V implementation to press to whatever patch you want from the patches dir + +Example: +vk.pl f +vk.pl p v testpress added_readme.vpatch + +4. To work on a previous version of the code and possibly branch from there: +delete the b dir +use your favourite V implementation to press to the vpatch of your choice from the patches dir +make a copy of your newly pressed code base into the b directory +simply work on your newly pressed code base and then use v_commit.sh whenever you want to press a new vpatch on top. + +Example: +rm -rf b +vk.pl p v newbranch vcodectrl_genesis.vpatch +cp -r newbranch b + +5. To clean up *everything* +rm -rf a b patches .seals .wot diff -uNr a/vcodectrl/manifest b/vcodectrl/manifest --- a/vcodectrl/manifest false +++ b/vcodectrl/manifest d55283314f18014e8911613a1b92dfc033534525b61bae982f1de584a6daec15f5c883e32d755e012665c35e305601956beb8470260452bc31529be5e159ce57 @@ -0,0 +1 @@ +616068 diana_coman vcodectrl_genesis Basic scripts for local/development code control via vpatches and a development/experiment V-tree. diff -uNr a/vcodectrl/scripts/v_commit.sh b/vcodectrl/scripts/v_commit.sh --- a/vcodectrl/scripts/v_commit.sh false +++ b/vcodectrl/scripts/v_commit.sh ddea08a315bf25578c0e9c1aac1ce14c375c1dbd2721e7cf98f76c1bc1e50029ecc4ae11acde2a6e7d9403c3f13c372de8ebd178295fe096bfeaec80037cfa28 @@ -0,0 +1,53 @@ +#!/bin/sh +#Diana Coman, 2020 + +#this creates another vpatch on a presumed existing tree previously genesised with the v_init.sh script +#requires working and accessible from current location: vdiff, gpg (with secret key for the name set below under personal knobs) +#NB: you should first update your manifest.txt file with the name of the new vpatch etc and then give that in the list of additional files (unless it's already in the source_dir directly, of course) + +#personal knobs - change as convenient for you +name="diana_coman_dev" + +#echo set +echo -e + +#get params/usage +if [ "$#" -le 2 ]; then + echo "Usage: .$0 project_name source_dir patch_name [additional files to include]" + exit 2 +fi + +projectName=$1 +srcDir=$2 +patchName=$3 + +dest="b/${projectName}/" + +#simply use previous a b structure that SHOULD be in place from v_init.sh +echo "Updating the a b structure and copying versioned files..." +rm -rf a +mv b a +mkdir b +mkdir b/$projectName + +cp -r $srcDir $dest + +#copy over any additional files given to go under versioning +for i in ${@:4} +do + echo "cp $i $dest" + cp $i $dest +done + +#make the vpatch and sign it +echo "Making the vpatch and signing it..." +vdiff a b > "${patchName}.vpatch" +gpg --armor --output "${patchName}.vpatch.${name}.sig" --detach-sig "${patchName}.vpatch" + +#move stuff to where it belongs +echo "Moving vpatch and sig..." +mv "${patchName}.vpatch.${name}.sig" .seals +mv "${patchName}.vpatch" patches + +echo "DONE." + diff -uNr a/vcodectrl/scripts/v_init.sh b/vcodectrl/scripts/v_init.sh --- a/vcodectrl/scripts/v_init.sh false +++ b/vcodectrl/scripts/v_init.sh 7494988edaccf740a493858e6ef39350de595a49ae5d2d02f16791afd986e89b91ed982581c326f7ac0d749fd01585d03f1255942abbdd31ff336de6ddd49e47 @@ -0,0 +1,55 @@ +#!/bin/sh +#Diana Coman, 2020 + +#init a V repository in this dir, using the given project_name, source dir and any other filenames to copy over +#requires working and accessible from current location: vdiff, gpg (with secret key for the name set below under personal knobs) + +#personal knobs - change as convenient for you +name="diana_coman_dev" +email="noemail@someemail.com" + +#echo set +echo -e +#set -x + +#get params/usage +if [ "$#" -le 1 ]; then + echo "Usage: .$0 project_name source_dir [additional files to include]" + exit 2 +fi + +projectName=$1 +srcDir=$2 +dest="b/$1/" +vname="${projectName}_genesis" + +#create the a b structure for vpatches +echo "creating the a b structure for vpatches..." +mkdir a +mkdir b +mkdir b/$1 +echo "cp -r $srcDir $dest" +cp -r $srcDir $dest + +#copy over any additional files given to go under versioning +for i in ${@:3} +do + echo "cp $i $dest" + cp $i $dest +done + +#make the vpatch and sign it +echo "Making the vpatch and signing it..." +vdiff a b > "${vname}.vpatch" +gpg --armor --output "${vname}.vpatch.${name}.sig" --detach-sig "${vname}.vpatch" + +#create the structure for pressing & testing - this is optional, so delete/comment it out if you don't want it! +echo "Making the patches .wot .seals structure for pressing and testing..." +mkdir patches +mkdir .seals +mkdir .wot +gpg --export $email > ".wot/${name}.asc" +mv "${vname}.vpatch" patches/ +mv "${vname}.vpatch.${name}.sig" .seals + +echo "DONE."