#!/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 '"'
echo "fsdfnsjfnsff" > "xx\"yy"
git add "xx\"yy"
git commit -a -m "quote in the file name"
# 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"
fn="a b c ș"
echo "aaa" > "${fn}"
git add "${fn}"
git commit -a -m "${fn} file commited"
fn="a b c<xss>"
echo "adsnjnfsdjnfsndfjksnaa" > "${fn}"
git add "${fn}"
git commit -a -m "${fn} file commited with xss"
mkdir -p " b"
fn=" b\a\b"
echo "aaafdsfsd" > "${fn}"
git add "${fn}"
git commit -a -m "${fn} commited: backslash in file name"
# Trying 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"
# Trying to add strange chars in file names
for f in 0 1 2 3; do
file=`php ../git_log1_strange.php ${f}`
echo "aaa" > "${file}"
git add "${file}"
git commit -m "strange chars in file name committed (f=${f})"
file=`php ../git_log1_strange.php ${f}`
echo "bbb" > "${file}"
git add "${file}"
git commit -m "strange chars in file name changed (f=${f})"
done
set +e
echo "Running git_log1_help.php..."
strace -s200000 -f -o git_log1.strace -tt php ../git_log1_help.php
if [ "${?}" != "0" ]; then
echo "git_log1_help.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 (diff between .final and .expected)!"
exit 1
fi
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