Creating an Audit Trail/Log for Sketch Access and Changes

Hi All,
I wondered if anyone knows of a way that will allow the generation of an audit trail as a sketch is accessed and edited?
It would be great if access to the sketch could be restricted via a password and then a login and time stamp generated each time the code was accessed. Logging of any changes made to the code would be a massive benefit, but I assume this would then require some complex crossover between the audit creation and the actual editing of the code?
I am aware that this will probably require execution in a third party manner and is counter intuitive to the open source nature of the arduino IDE.
Any pointers in the right direction would be massively appreciated!

Background:
I am a PhD student trying to create automatically generated records, in accordance with FDA and EMA regulations, for an automated arduino controlled processing system used for medical research.

There are several “version control” systems used by professional and hobby programmers. GIT seems to be the most popular at the moment.

I don’t use it myself and I don’t think it (or any of the others) provide all of the features you have in mind - in particular I am not aware of any system that restricts access to code.

In general these systems require you to “do something” when you have got to a stage where you want to save the current version of your system.

Most Operating Systems apply an ownership system to files so that others cannot access your work.

For my own purposes I wrote a simple Python program that automatically makes an archive copy of the code that is uploaded to an Arduino and places in the program code a Serial.print() statement with the name of the archive copy so that by running the Arduino program I can identify the code that created it.

…R

I use (Tortoise)Git for version control, also for Arduino sketches and libraries. SVN should be usable as well. The rest is fully independent from the Arduino installation and IDE, depends on the used VCS and server.

With a VCS you have full control over what's stored in the repository, and who is allowed to store modifications. You even can have a shared repository on another server (GitHub...), so that other people can access your code as well. It depends on the server whether and how checkouts or downloads are logged. If you want to use a shared archive, ask your school whether and which VCS are supported on their servers, and whether private (restricted) archives are available.

Thanks very much Robin2 and DrDiettrich, your help is greatly appreciated! Turns out my University has a GitHub repository, so I will be trying to use that.

I can make 20 insignifigant tweeks, altering line spaces, adding comments, etc. total waste of time to record any of that.

however... when you hit the VERIFY button, it would be nice if a drop down, or pop-up appeard.

'Did the last version of this sketch work ?' Y / N
if it did, then please post what you liked about it and also a reason for this change.

95% of the time, I might hit N and move on, but There are more than a few times I would have liked to have that option and go back to it.

dave-in-nj:
I can make 20 insignifigant tweeks, altering line spaces, adding comments, etc. total waste of time to record any of that.

I would tend to agree with you, but the OP mentioned:

TJ24:
in accordance with FDA and EMA regulations, for an automated arduino controlled processing system used for medical research.

in which case he probably does need to capture every ticky little thing.

I have not been good at documenting projects and I have a short attention span so I jump from one to another. Then I can't remember where I got to with the first one. OK, the most recent file is probably it, and I mostly write readable code. But on many occasions, especially with bigger projects that have several files, I have wasted quite a lot of time trying to bring by "brain" back into focus.

Separately, I have always found it useful to write little essays to discuss (with myself) how I am going to implement a project or how to deal with problems - symptoms, possible causes and ideas for tests towards a solution.

Very recently it occurred to me to keep a simple text file with a "developmen record" as I work on a project. This hass turned out to be surprisingly useful as it records the thought process and the changing program file-names as the project evolves through its versions. I also include a cross-reference to other projects in which I might explore a particular part of the problem.

I use the Geany text editor for all my program development so the DevRec file can sit in a separate tab beside the code file(s) I am working on. That means there is no organisational barrier that my makes me defer writing a note.

And, for the avoidance of doubt, I do not use any formal Version Control System. I know many people think they are wonderful / essential but I have never really got my head around the concept. And I don't like the idea that I MUST comply with some "BigBrother" system - even if it is totally on my own PC.

...R

Delta_G:
I would tend to agree with you, but the OP mentioned:

in which case he probably does need to capture every ticky little thing.

I would believe that only testing would need to be recorded.
in my mind, that is when you write to the chip and not just because you were verifying the code was passing muster.

but in the case of complete history, the log of everything you changed between trials might be important or required.

personally, I think the pop-up to let you put in notes on why you just changed stuff would suffice.