======================== Getting Started with Git [TOC] ======================== ---- VIDEO ------------------------------ https://www.youtube.com/embed/qWJzr5j67Ps ----------------------------------------- Exercise: ABC Compiler Project ============================== Create a repository for the project. Initialize it with what we have developed so far: :import: session15/abc/Makefile [fold] :import: session15/abc/lexer.h [fold] :import: session15/abc/lexer.c [fold] :import: session15/abc/xtest_lexer.c [fold] :import: session15/abc/test_lexer.in [fold] Some Bugfix =========== You certainly saw that there was a bug in _lexer.c_. The column number of a token was not correct. This was fix with a new commit: ---- CODE (type=txt) ----------------------------------------------------------- MCL:abc lehn$ git show 10aef1fe0e95973b6f2e05a59b88cea71b8cd3c2 commit 10aef1fe0e95973b6f2e05a59b88cea71b8cd3c2 (HEAD -> master, tag: v.0.0.2, origin/master, origin/HEAD) Author: Michael C. Lehn Date: Fri Jun 10 09:27:29 2022 +0200 bug fix: col number diff --git a/lexer.c b/lexer.c index e202c80..01e552d 100644 --- a/lexer.c +++ b/lexer.c @@ -22,7 +22,7 @@ nextCh(void) ch = getchar(); if (ch == '\n') { ++curr_line; - curr_col = 1; + curr_col = 0; } return ch; } -------------------------------------------------------------------------------- Afterwards the tag _v.0.0.2_ had to be changed. It still was the tag for the buggy commit. For that the tag _v.0.0.2_ in the local repository was deleted and also in the remote repository: ---- CODE (type=txt) ----------------------------------------------------------- git -d v.0.0.2 git push --delete origin v.0.0.2 -------------------------------------------------------------------------------- After that the new commit with the bug fix got the tag _v.0.0.2_ and tags were also pushed to the remote repository: ---- CODE (type=txt) ----------------------------------------------------------- git tag v.0.0.2 -a git push origin --tags -------------------------------------------------------------------------------- ABC Compiler Project: Tag v.0.0.2 ================================= ---- SHELL (path=session15/git, hide) ------------------------------------------ rm -rf abc git clone git@gitlab.com:uni-ulmulm-university-department-of-numerical-analysis/abc.git git config --global advice.detachedHead true -------------------------------------------------------------------------------- With _git checkout tags/_ you can go back to a given tag in your repository. I will use this so that you can see below my state of the project with tag _v.0.0.2_: ---- SHELL (path=session15/git/abc) -------------------------------------------- git checkout tags/v.0.0.2 -------------------------------------------------------------------------------- And of course you can follow git's advice to get rid of this message... :import: session15/git/abc/lexer.c [fold] :import: session15/git/abc/lexer.h [fold] :import: session15/git/abc/Makefile [fold] :import: session15/git/abc/README.md [fold] :import: session15/git/abc/test_lexer.in [fold] :import: session15/git/abc/xtest_lexer.c [fold]