Is there a way to use git with Pick D3 database since the source code and compiled programs are stored inside D3?
I think the only option would be to build routines to import/export the source code into the files in D3, but that seems like a lot of work, and also easily bypassable with the built-in editors in D3.
Please advise if this answer is too sparse, and of course please accept if this answers the question for you. I use GitHub but I do not have a private Git repo anywhere and I never use the command-line. However, I do use the following technique with Subversion, and since none of this is VCS-specific it will work with Git, Hg, and anything else.
The solution is to use the D3 OSFI.
EXECUTE "!cmd -options ..." CAPTURING OUT
in order to do a commit. Catalog that program as COMMIT or GIT.COMMIT.So now you edit/compile/run your programs as normal from within D3. When ready, just execute COMMIT, provide comments or other details, and your program will handle the OS-level details. The response back should be displayed and/or logged.
At this point you might decide to edit your BASIC code outside of D3 and then send a COMPILE command into D3 (because the object needs to be generated in the VME and stored in the Dict).
You might also want to add to your "library" of git wrapper commands in BASIC for rollbacks and other functions.
You want a QS pointer so that the BASIC programs also get saved in the D3 file-save and account-saves. This could cause problems if you need to restore, you should experiment with this. If you save the account and then restore it somewhere else you could have headaches as the data from the save will overlay whatever is in the host OS.
When setting up the QS pointer, don't use DOS: or UNIX: host extensions, just use a path like C:/Dev/Git/RepoD3, or for *nix /home/dev/git/repoD3. If you use the wrong host extension you'll have the wrong EOL delimiters in your data. You also may not want tabs converted to spaces and vice-versa. Experiment with this and you might decide to create your own host extension which does exactly what you want. (Outside the scope of this response.)
In step 8, you could do a commit from TCL using !command-line. You don't need the BASIC wrapper. However there could be issues with server output trying to work its way back through that channel, so I strongly advice doing the OS functions from BASIC. You can use something like this to respond to multiple prompts:
CMD = "!do this "
CMD := OPTIONS
CMD<-1> = Response.To.First.Prompt
CMD<-1> = Second.Response
EXECUTE CMD CAPTURING OUT
That way nothing gets hung up.