From d8c36ed6665a9b1d136c027206db0d4abb37f7b7 Mon Sep 17 00:00:00 2001 From: Dennis Buchhorn Date: Mon, 15 Nov 2021 11:52:28 +0100 Subject: [PATCH] feat: update .gitignore, hooks and README ; add README template --- .gitea/template | 1 + .githooks/post-checkout | 2 +- .githooks/pre-commit | 2 +- .gitignore | 2 ++ README.md | 4 ++++ README_PROJECT_TEMPLATE.md | 43 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .gitea/template create mode 100644 README_PROJECT_TEMPLATE.md diff --git a/.gitea/template b/.gitea/template new file mode 100644 index 0000000..30ad5d9 --- /dev/null +++ b/.gitea/template @@ -0,0 +1 @@ +README_PROJECT_TEMPLATE.md diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 0828942..fbb9c24 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -5,7 +5,7 @@ listFilesToSubstitute=$(find -name *.gitsubstitute) listStaticPathFiles=$(git grep -lr --untracked $repoRoot) listStagedFiles=$(git diff --staged --name-only) -staticPathSubstitution="\${REPO_ROOT}" +staticPathSubstitution="\$\$\${GITSUBSTITUTE_REPO_ROOT}" for entryFileToSubstitute in $listFilesToSubstitute; do fullPath="${repoRoot}/${entryFileToSubstitute}" diff --git a/.githooks/pre-commit b/.githooks/pre-commit index f9b3c9f..11854e4 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -4,7 +4,7 @@ repoRoot=$(git rev-parse --show-toplevel) listStaticPathFiles=$(git grep -lr --untracked $repoRoot) listStagedFiles=$(git diff --staged --name-only) -staticPathSubstitution="\${REPO_ROOT}" +staticPathSubstitution="\$\$\${GITSUBSTITUTE_REPO_ROOT}" for entryStagedFile in $listStagedFiles; do for entryStaticPathFile in $listStaticPathFiles; do diff --git a/.gitignore b/.gitignore index 7ca7304..e880945 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /.metadata/ /RemoteSystemsTempFiles/ .analytics +.Xil/* +vitis_pid*.str # ignore all log files **/*.log diff --git a/README.md b/README.md index 186ad9a..fbd9d59 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ Trying to make Vitis more git-friendly. +## Use this repository as template + +When you use this repository as template, in the new created repository you can delete this file and rename `README_PROJECT_TEMPLATE.md` to `README.md`. + ### Requirements - Tested on Vitis 2020.2 diff --git a/README_PROJECT_TEMPLATE.md b/README_PROJECT_TEMPLATE.md new file mode 100644 index 0000000..45340ea --- /dev/null +++ b/README_PROJECT_TEMPLATE.md @@ -0,0 +1,43 @@ +# ${REPO_NAME} + +Created with Vitis Version 2020.2 + +Created from Template [`${TEMPLATE_NAME}`](${TEMPLATE_LINK}) + +### Getting started + +1. After cloning the repository execute the following commands in the cloned folder: + + - `git config --local core.hooksPath .githooks` - set path to git-hooks for this repository. + + - `git checkout BRANCH` - checkout the BRANCH you want to work with (e.g. `master`) which create local project files (because the hook script will be executed now ; this could take a while). + +2. Open Vitis and select the cloned folder as workspace. + +3. Click on `Inport Project`, choose `Import projects from Git` and click `Next >`. + +4. Choose `Existing local repository` and click `Next >`. + +5. Choose the cloned / workspace folder (should be the only entry) and click `Next >`. + +6. Choose `Import existing Eclipse projects` and click `Next >`. + +7. Leave everything unchanged and click `Finish`. + +### Workflow + +- When you want to commit your work, add all files with `git add .` - Not relevant files will be ignored by the `.gitignore` file. + +#### Checkout branch + +- It is recommended that you follow these steps to checkout a branch: + + - Close Vitis. + + - Make sure all work is commited. + + - Clean up workspace folder with `git clean -dfx`. + + - `git checkout BRANCH` - checkout the BRANCH you want to work with (e.g. `master`) which create local project files (because the hook script will be executed now ; this could take a while). + + - Follow the instructions in the `Getting started` section from step `2`.