Skip to content

Commit 1e3bc64

Browse files
committed
prep stage 10
2 parents 9891d97 + a7b32c7 commit 1e3bc64

File tree

5 files changed

+32
-50
lines changed

5 files changed

+32
-50
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,8 @@ venv.bak/
106106
# editors
107107
.vscode/
108108
.idea/
109+
110+
# vim swp files
111+
*.swp
112+
*.swo
113+

.travis/runme.sh

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,52 +43,19 @@ function echo_parents_amount {
4343

4444
printaline
4545

46-
# Check if the script itself ran successfully.
47-
python ENCOM/login.py CLU
48-
login_exit_code=$?
49-
if [ $login_exit_code -ne 0 ];
50-
then bad "Login failed...";
51-
fi
52-
53-
echo "Fetching tags..."
54-
git fetch --tags
55-
56-
flamenco_commit_hash=$( echo_tag_commit_hash flamenco-wens-violer-tag )
46+
ls add_files_here -1
5747

58-
parent_1=$( git log -1 | head -2 | tail -1 | awk '{ print $2 }' )
59-
parent_2=$( git log -1 | head -2 | tail -1 | awk '{ print $3 }' )
48+
how_many_files=$(ls add_files_here -1 | wc -l)
6049

61-
echo "Let's look at the log..."
62-
git log --oneline --graph -n 10 --decorate
63-
64-
echo "parent 1 hash: " $parent_1
65-
echo "parent 2 hash: " $parent_2
66-
67-
# which parent is the user's commit?
68-
users_commit_hash=""
69-
if [[ $parent_1 = $flamenco_commit_hash ]] # parent1 is NOT the user's commit
70-
then users_commit_hash=$parent_2
71-
else users_commit_hash=$parent_1
50+
if [ $how_many_files -lt 99 ];
51+
then bad "Not enough files: only "$how_many_files", need more than 99"
7252
fi
7353

74-
echo "User's commit was ${users_commit_hash}"
75-
76-
distance_to_flamenco=$( git rev-list --count ${flamenco_commit_hash}..${users_commit_hash} )
77-
78-
echo "Distance to flamenco: ${distance_to_flamenco}"
79-
80-
if [[ distance_to_flamenco -ne 1 ]]
81-
then
82-
bad "Should solve this using only one commit!"
54+
# Check how many commits the user needed - shouldn't be more than 3 be two (the user commit + merge commit)!
55+
commit_amount=$( git log premove-refile-misnomer-tag.. --oneline | wc -l )
56+
if [ $commit_amount -gt 3 ];
57+
then bad "Too many commits! Took "$commit_amount" commits";
8358
fi
8459

85-
echo "Trying to find v1.0.1104001 tag..."
86-
rinz_ver_commit_hash=$( echo_tag_commit_hash v1.0.1104001 )
87-
if [[ $rinz_ver_commit_hash != $users_commit_hash ]]
88-
then
89-
bad "Didn't find version tag!"
90-
fi
91-
printaline
92-
93-
flag "premove-refile-misnomer"
60+
flag "shill-foe-pickler"
9461
exit 0

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,9 @@ For how to use a specific command you always have `git help`. For a good explana
7676

7777
### Stage 10
7878

79-
![HarderBetterFasterStronger](https://media.giphy.com/media/qTmjKxXDwvK7K/giphy.gif)
79+
**For this stage, you must run the script `setup_stage_10.sh` first!**
8080

81-
You win!
82-
83-
![you win](https://media.giphy.com/media/POH5k3dYNLrqa7SbVa/giphy.gif)
84-
85-
Please create a file with your feedback under `.management/feedback` and open a Pull Request with it.
86-
87-
Thanks for playing!
81+
Try to commit something.
8882

8983
## License
9084

githooks/commit-msg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
if [ grep -i "git is awesome" $1 ]; then
4+
echo "Write 'git is awesome' in your commit message"
5+
exit 1
6+
else
7+
echo "I agree; git is awesome!"
8+
exit 0
9+
fi

setup_stage_10.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
echo "Setting up stage 10..."
2+
3+
cd .git/hooks
4+
ln -s -f ../../githooks/pre-commit pre-commit
5+
cd ..
6+
7+
echo "Done."

0 commit comments

Comments
 (0)