This commit is contained in:
Miloslav Ciz 2024-11-20 22:22:24 +01:00
parent ab70baf524
commit 481775ca4b
11 changed files with 1933 additions and 1890 deletions

View file

@ -8,11 +8,49 @@ TODO
TODO
## LRS Version Numbering
## LRS Version Numbering Systems
At [LRS](lrs.md) we suggest the following version numbering (invented/employed by [drummyfish](drummyfish.md)): { OFC I don't know if anyone else is already doing this, I'm not claiming any history firsts, just that this is what I independently started doing in my projects. ~drummyfish }
Here are some possible version numbering systems usable by [LRS](lrs.md).
This is a simple system that tries to not be [dependent](dependency.md) on having a [version control system](vcs.md) such as [git](git.md), i.e. this system works without being able to make different development branches and can be comfortably used even if you're just developing a project in a local directory without any fancy tools. Of course you can use a VCS, this system will just make you depend less on it so that you can make easier transitions to a different VCS or for example drop a VCS altogether and just develop your projects in a directory with FTP downloads.
### Source Hash As Version
We can make the version number be automatically derived, for example using the [hash](hash.md) or [checksum](checksum.md) of the source code, or maybe even better use the Unix timestamp of latest commit (that will allow to determine which version is newer), or something along these lines.
Here is a small **example** in C. The source code may look like this:
```
gcc tmp.c -D VERSION=`cat tmp.c anarch_con.zip | cksum -a crc | sed "s/\([0-9]*\) [0-9]*/\1/g"`
#include <stdio.h>
#ifndef VERSION
#warning you should define VERSION
// #error please define VERSION // this enforces the definition
#define VERSION 0
#endif
int main(void)
{
printf("program version: %u\n",VERSION);
return 0;
}
```
And may be compiled like this:
```
gcc program.c -D VERSION=`cat program.c | cksum -a crc | sed "s/\([0-9]*\) [0-9]*/\1/g"` -o program
```
And writes out:
```
program version: 1958623590
```
### Numbering only releases
Another relatively simple system, closer to the mainstream ones, that tries to not be [dependent](dependency.md) on having a [version control system](vcs.md) such as [git](git.md), i.e. this system works without being able to make different development branches and can be comfortably used even if you're just developing a project in a local directory without any fancy tools. Of course you can use a VCS, this system will just make you depend less on it so that you can make easier transitions to a different VCS or for example drop a VCS altogether and just develop your projects in a directory with FTP downloads.
Version string is of format *major.minor* with optional suffix letter `d`, e.g. 0.35, 1.0 or 2.1d.
@ -48,8 +86,4 @@ Here is an example of version numbering a project with the LRS system:
| 2.0d | added a few features | no |
| 2.0d | fixed a bug | no |
| 2.01 | a few nice improvements | YES |
| ... | ... | ... |
## Even More KISS System
Make the version number be automatically derived, for example use the [hash](hash.md) of the source code as version number, or maybe even better use the Unix timestamp of latest commit (that will allow to determine which version is newer), or something similar.
| ... | ... | ... |