#!/bin/bash
set -e
rm -rf git_log1
mkdir git_log1
cd git_log1
git init
git remote add origin ssh://rocketgit@ssh.rocketgit.com/user/catalinux/test1
echo "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" > a
git add a
git commit -a -m "a"
# special file that contains '"'
touch "xx\"yy"
git add "xx\"yy"
git commit -a -m "quote file"
# empty file
touch empty.txt
git add empty.txt
git commit -a -m "commit empty file"
cp a a2
git add a2
git commit -a -m "a copied to a2"
# let's see if we can correcly parse a rename and another operation
echo "aaaaaaaaaaaaaaaaaaaa" > c
git add c
git mv a2 a3
git commit -a -m "a2 moved to a3 and added c"
git rm a3
git commit -a -m "a3 removed"
echo "aaa" > "a b c"
git add "a b c"
git commit -a -m "\"a b c\" file commited"
# Try to trigger dissimilarity stuff
echo "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" > dis1
echo "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" >> dis1
git add dis1
git commit -a -m "dis1 commited"
echo "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" > dis1
echo "caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" >> dis1
git commit -a -m "dis1 changed"
set +e
echo "Running git_log1.php..."
php ../git_log1.php
if [ "${?}" != "0" ]; then
echo "git_log1.php exited with error."
exit 1
fi
cd ..
echo "Building diff..."
diff -u git_log1.final git_log1.expected > git_log1.diff
if [ "${?}" != "0" ]; then
echo "Error: check git_log1.diff!"
exit 1
fi
echo "git_log1: OK"
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master