0

I have a RTOS code, and soon we are going to start a new RTOS project (I say "RTOS" to maintain the question in general, but the one we are employing is ThreadX)

The code is git managed but not very well managed. For starters it does not ignore built files , it does not have an .gitignore file or gitmodules.

My question is how should a RTOS project be git managed? examples of gitignore or gitmodule will be helpful

One issue that is calling my attention is for example: Should I put all the RTOS code in a submodule? In order to keep it independent of the main code?

KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
  • 1
    There are many examples of Git workflows. Firstly from your question it seems obvious that you need to put appropriate entries in your .gitignore. Number of developers, speed of CI/CD might have some bearing on which approach you take. Perhaps read this https://www.atlassian.com/git/tutorials/comparing-workflows – Nick.Mc Jul 11 '21 at 23:19
  • I am wondering not only about the ignore thing (which is a priority I think) but also if the RTOS code should be separated in a module... – KansaiRobot Jul 11 '21 at 23:49
  • 1
    Do you mean one of these? https://git-scm.com/book/en/v2/Git-Tools-Submodules this is definitely out of my expertise. All I can say is that it is worthwhile planning this stuff. Perhaps you should start with requirements (number of developers etc.) – Nick.Mc Jul 12 '21 at 00:00
  • 1
    This question of mine is somewhat related: https://stackoverflow.com/questions/60010580/should-cmsis-libraries-be-included-in-version-control – Tagli Jul 12 '21 at 06:04
  • @Tagli very good question. Thanks! – KansaiRobot Jul 12 '21 at 07:22
  • I cannot see how this differs form management of third-party library code in general - it is not RTOS specific. – Clifford Jul 31 '21 at 19:12

1 Answers1

1

azure-rtos/threadx/.gitignore or azure-rtos/filex/.gitignore are good examples of the kind of .gitignore file you would need for this type of project.

Your project can then reference the different component as submodules, as done in renesas/azure-rtos/.gitmodules, if you need their sources directly in your codebase.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I am a bit concerned that the ignore files do not explicitly ignore built object and executable files. (I suppose it is because they are generated in the build folder -which is ignored. Also I can see that the Makefile s are ignored, I suppose because it uses CMake though my project uses Makefile s directly – KansaiRobot Jul 12 '21 at 09:57
  • @KansaiRobot Yes, if a folder is ignored, its content is also. You can verify this with `git check-ignore -v -- build/aFile`. See also https://www.toptal.com/developers/gitignore/api/cmake – VonC Jul 12 '21 at 12:05