Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide with a uniform backup mechanism that doesn't litter #191

Open
piojo-zz opened this issue Oct 6, 2016 · 0 comments
Open

Provide with a uniform backup mechanism that doesn't litter #191

piojo-zz opened this issue Oct 6, 2016 · 0 comments

Comments

@piojo-zz
Copy link
Member

piojo-zz commented Oct 6, 2016

Having backups in the same directory is too brittle. Rolling back if a validation has failed implies adding code to move old files around, which has to be tested and its bugs addressed. An uniform CAF API that handled the case, like

use CAF::VersionControl;
use CAF::FileWriter;
...
my $vc = CAF::VersionControl->new();
my $f1 = CAF::FileWriter->new(...);
my $f2 = CAF::FileWriter->new(...);
$vc->add($f1, $f2);
print $f1;
$fh->close();
if (config_is_sane()) {
    $vc->commit();
} else {
    $vc->revert();
}

Or something similar. We can rely on Git directly, using GIT_DIR and GIT_WORK_TREE environment variables or use etckeeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant