Browse Source

Last improvements on exercises

Pierre-Yves Barriat 2 years ago
parent
commit
9ace9ae840

+ 1 - 1
exercices/ex.2/README.md

@@ -3,7 +3,7 @@ You just wrote a cpp program that reads it config from a file named `conf.ini`
 As you don't want to bother adding all files manualy, you have decided to use `.gitignore`
 
 You need to create a `.gitignore` file that will:
-- ignore all files that end with a `~` (backup files)
+- ignore all files that end with suffix `.swp` (backup files)
 - ignore every files in the `out` directory except `conf.ini`
 
 In other words, once the `.gitignore` file written, the command `git add .` should only stage:

+ 1 - 1
exercices/ex.2/linux_create.sh

@@ -3,7 +3,7 @@
 rm -rf out main.cp* 2> /dev/null
 
 touch main.cpp
-touch main.cpp~
+touch main.cpp.swp
 
 mkdir out
 touch out/main.o

+ 2 - 2
exercices/ex.2/win_create.bat

@@ -2,7 +2,7 @@
 
 SET SOME_VAR="main.cpp"
 DEL /S "%SOME_VAR%" || echo "file not found"
-SET SOME_VAR="main.cpp~"
+SET SOME_VAR="main.cpp.swp"
 DEL /S "%SOME_VAR%" || echo "file not found"
 SET SOME_VAR=out
 RD /S /Q "%SOME_VAR%" || echo "file not found"
@@ -12,7 +12,7 @@ EXIT /B %ERRORLEVEL%
 
 :_ex
 echo >"main.cpp"
-echo >"main.cpp~"
+echo >"main.cpp.swp"
 mkdir "out"
 echo >"out\main.o"
 echo >"out\a.out"

+ 1 - 1
exercices/ex.3/README.md

@@ -1,4 +1,4 @@
-You just realized that you have commited a backup file: `main.cpp~`
+You just realized that you have commited a backup file: `main.cpp.swp`
 
 Backup files should not be commited, let's correct that mistake :
 

+ 1 - 1
exercices/ex.3/linux_create.sh

@@ -3,6 +3,6 @@
 rm -f main.cp* 2> /dev/null
 
 touch main.cpp
-touch main.cpp~
+touch main.cpp.swp
 git add .
 git commit -m "first commit"

+ 2 - 2
exercices/ex.3/win_create.bat

@@ -2,7 +2,7 @@
 
 SET SOME_VAR="main.cpp"
 DEL /S "%SOME_VAR%" || echo "file not found"
-SET SOME_VAR="main.cpp~"
+SET SOME_VAR="main.cpp.swp"
 DEL /S "%SOME_VAR%" || echo "file not found"
 CALL :_ex
 
@@ -10,7 +10,7 @@ EXIT /B %ERRORLEVEL%
 
 :_ex
 echo >"main.cpp"
-echo >"main.cpp~"
+echo >"main.cpp.swp"
 
 git add .
 git commit -m "first commit"

+ 7 - 54
exercices/ex.4/README.md

@@ -1,57 +1,10 @@
-## PART 1
+You just ran a `git fetch` and realize someone has modified the exact file at the exact line that you just worked on.
 
-You have worked hard and the result is beautiful.
-But somehow there's a bug.
+You want the current state of your working directory to be saved.
 
-It's late, your partner wants you to go home.
+Conflict seems inevitable.
 
-Hell, maybe a good night sleep (or a good night something else) will help you find that stupid bug.
-
-So you want to go home, but you don't want to leave the work unsaved, that would be unprofessional. And you're a pro.
-
-So, as the code cannot be merged into master yet, you decide to create a branch.
-
-- create and checkout a new branch named "file-second"
-- commit the current state
-- push it (remember, the branch does not exists yet on origin)
-
-## PART 2
-
-Your mind is clear and ready to tackle that nasty bug.
-As you march to your desk like the conquerant you are, your boss stops you.
-
-There's an urgent fix that needs to go out in prod just right now.
-
-- checkout the branch master
-- pull it to get the last version
-- add a "three" to the file first.txt
-- commit and push the changes to that new file
-
-## PART 3
-
-Now is the time to tackle the problem, let's get back to your work.
-
-- checkout the branch file-second
-
-
-## PART 4
-
-Of couuuuurse !
-You found it, the 'E' is missing between 'D' and 'F'
-
-After fixing the bug, the awesomeness can be mnerged into master.
-
-- modify the file so that it's beauty is complete
-- commit the difference
-- push it
-- merge it into master
-- push master
-- brag
-
-
-## PART 5
-
-You are a good citizen (or at least in this story we assume you are).
-You are not working anymore on the branch file-second
-
-- delete the branch file-second both localy and in origin
+- create a commit with the new version of first.txt
+- use `git pull` to merge origin/master into your master
+- resolve the conflict in first.txt
+- commit

+ 2 - 2
exercices/ex.4/linux_create.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-rm -f first.txt second.txt 2> /dev/null
+rm -f first.txt 2> /dev/null
 
 touch first.txt
 git add .
@@ -11,4 +11,4 @@ echo "two" >> first.txt
 git commit -am "Added two"
 git push -u origin master
 git reset --hard HEAD~1
-echo "A B C D F G" >> second.txt
+echo "three" >> first.txt

+ 2 - 4
exercices/ex.4/win_create.bat

@@ -2,14 +2,12 @@
 
 SET SOME_VAR="first.txt"
 DEL /S "%SOME_VAR%" || echo "file not found"
-SET SOME_VAR="second.txt"
-DEL /S "%SOME_VAR%" || echo "file not found"
 CALL :_ex
 
 EXIT /B %ERRORLEVEL%
 
 :_ex
-echo >"first.txt"
+echo >first.txt
 git add .
 git commit -m "First commit"
 echo "one">>first.txt
@@ -18,5 +16,5 @@ echo "two">>first.txt
 git commit -am "Added two"
 git push -u origin master
 git reset --hard HEAD~1
-echo "A B C D F G">second.txt
+echo "three">>first.txt
 EXIT /B 0

+ 54 - 7
exercices/ex.5/README.md

@@ -1,10 +1,57 @@
-You just ran a `git fetch` and realize someone has modified the exact file at the exact line that you just worked on.
+## PART 1
 
-You want the current state of your working directory to be saved.
+You have worked hard and the result is beautiful.
+But somehow there's a bug.
 
-Conflict seems inevitable.
+It's late, your partner wants you to go home.
 
-- create a commit with the new version of first.txt
-- use `git pull` to merge origin/master into your master
-- resolve the conflict in first.txt
-- commit
+Hell, maybe a good night sleep (or a good night something else) will help you find that stupid bug.
+
+So you want to go home, but you don't want to leave the work unsaved, that would be unprofessional. And you're a pro.
+
+So, as the code cannot be merged into master yet, you decide to create a branch.
+
+- create and checkout a new branch named "file-second"
+- commit the current state
+- push it (remember, the branch does not exists yet on origin)
+
+## PART 2
+
+Your mind is clear and ready to tackle that nasty bug.
+As you march to your desk like the conquerant you are, your boss stops you.
+
+There's an urgent fix that needs to go out in prod just right now.
+
+- checkout the branch master
+- pull it to get the last version
+- add a "three" to the file first.txt
+- commit and push the changes to that new file
+
+## PART 3
+
+Now is the time to tackle the problem, let's get back to your work.
+
+- checkout the branch file-second
+
+
+## PART 4
+
+Of couuuuurse !
+You found it, the 'E' is missing between 'D' and 'F'
+
+After fixing the bug, the awesomeness can be mnerged into master.
+
+- modify the file so that it's beauty is complete
+- commit the difference
+- push it
+- merge it into master
+- push master
+- brag
+
+
+## PART 5
+
+You are a good citizen (or at least in this story we assume you are).
+You are not working anymore on the branch file-second
+
+- delete the branch file-second both localy and in origin

+ 2 - 2
exercices/ex.5/linux_create.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-rm -f first.txt 2> /dev/null
+rm -f first.txt second.txt 2> /dev/null
 
 touch first.txt
 git add .
@@ -11,4 +11,4 @@ echo "two" >> first.txt
 git commit -am "Added two"
 git push -u origin master
 git reset --hard HEAD~1
-echo "three" >> first.txt
+echo "A B C D F G" >> second.txt

+ 4 - 2
exercices/ex.5/win_create.bat

@@ -2,12 +2,14 @@
 
 SET SOME_VAR="first.txt"
 DEL /S "%SOME_VAR%" || echo "file not found"
+SET SOME_VAR="second.txt"
+DEL /S "%SOME_VAR%" || echo "file not found"
 CALL :_ex
 
 EXIT /B %ERRORLEVEL%
 
 :_ex
-echo >first.txt
+echo >"first.txt"
 git add .
 git commit -m "First commit"
 echo "one">>first.txt
@@ -16,5 +18,5 @@ echo "two">>first.txt
 git commit -am "Added two"
 git push -u origin master
 git reset --hard HEAD~1
-echo "three">>first.txt
+echo "A B C D F G">second.txt
 EXIT /B 0

+ 0 - 0
project/linux/functions/greetings.sh


+ 0 - 0
project/linux/run.sh


+ 0 - 0
project/linux/working_environment/env.sh


+ 0 - 0
resources/getting_started.sh


+ 0 - 0
slides/compile.sh