Skip to content

Restoring the history

Olexandr Konovalov edited this page Feb 28, 2023 · 2 revisions

This page documents how this repository was populated with several previous versions of ARTwarp.

First, files were placed in the directories as follows:

ARTwarp_2003-11-25
ARTwarp_2019-01-11
ARTwarp_2021-10-01

Then, an empty repository was created on GitHub at https://github.com/olexandr-konovalov/artwarp.git.

After that, the following script was run:

#!/bin/sh

# reset the directory for the new repository
rm -r artwarp
mkdir artwarp

# initialise the repository
cd artwarp
git init
git remote add origin https://github.com/olexandr-konovalov/artwarp.git 
cd ..

reldate=2003-11-25
rm -f artwarp/*.*
cp -r ARTwarp_$reldate/* artwarp/
cd artwarp
rm *.txt # do not keep data files
mac2unix *
dos2unix *
git add *
git commit --all -m "Version of $reldate"
git commit --amend --no-edit --date "$reldate"
git commit --amend --author="Vincent Janik <[email protected]>" --no-edit
git branch -M main # for the 1st commit
cd ..

reldate=2019-01-11
rm -f artwarp/*.*
cp -r ARTwarp_$reldate/* artwarp/
cd artwarp
mac2unix *
dos2unix *
git add *
git commit --all -m "Version of $reldate"
git commit --amend --no-edit --date "$reldate"
git commit --amend --author="Vincent Janik <[email protected]>" --no-edit
cd ..

reldate=2021-10-01
rm -f artwarp/*.*
cp -r ARTwarp_$reldate/* artwarp/
cd artwarp
mac2unix *
dos2unix *
git add *
git commit --all -m "Version of $reldate"
git commit --amend --no-edit --date "$reldate"
git commit --amend --author="Vincent Janik <[email protected]>" --no-edit

# make sure that Vincent is not only the author, but also the committer
git filter-branch -f --env-filter "
    GIT_AUTHOR_NAME='Vincent Janik'
    GIT_AUTHOR_EMAIL='[email protected]'
    GIT_COMMITTER_NAME='Vincent Janik'
    GIT_COMMITTER_EMAIL='[email protected]'
  " HEAD

Finally, after inspecting the git log, the repository was pushed to GitHub. Since it required several attempts, --force was used to reset the remote repository.

git push -u origin main --force
Clone this wiki locally