Reanimating the blog
After almost five years of inactivity, i'm trying to reanimate this blog.
Yesterday and the day before, i was coding a small bashscript to apply changes made to one common.html file to all other files in a directory. There was not really a website to apply it to, but i was thinking about reanimating this blog.
Today i tried applying it to this dead blog. There are still some problems. For example when i made a change to the commonn.html and run the script, i immediatelty have to commit all the changes before making new changes. So when the changes aren't any good, i have to make a commit with stupid code. Also if i have uncommitted changes in the other files, the conflicts end up in the common.html file. I have to think about a way to solve this.
The script looks like this for the moment:
jfcommon() {
git stash push common.html
for file in *.html; do
if [[ $file != common.html ]]; then
cp $file common.html
git add common.html
git commit -m "Add common.html"
git stash apply
cp common.html $file
git reset HEAD~1
fi
done
git checkout common.html
git stash pop
}
I also have to mark lines with html comments to indicate if the changes apply only to the file or to all files. They are needed to stop the diffs from interfering. There is no way around it, i think. But it is not that bad to know where you can make changes.
Anyway i need to take the trash out now and go to bed. I hope i remember how to continue in five years.