[fpc-other] GIT versioning server on Raspberry Pi?

Bo Berglund bo.berglund at gmail.com
Wed May 31 10:58:29 CEST 2017


On Wed, 31 May 2017 01:03:54 +0100, Graeme Geldenhuys
<mailinglists at geldenhuys.co.uk> wrote:

Graeme, I am very grateful for your contribution to this discussion!
Aplogies if my postings are a bit longish, but I try to convey my
concerns and ignorance...

>> So this should not be created inside some user home then?
>
>You can create Git repositories wherever you want and have read/write 
>access. My "/data" path is simply by 8TB ZFS data pool, where I do all 
>my work and store all vital data. You can use your $HOME directory 
>(whatever that translates to on your OS) just as well.

In the end, if all works out well, I want to have a GIT *server* on
our company network as the main repository, acessed via the internal
network by authenticated developers only. It would be the "remote"
mentioned in several GIT how-to pages I have read.
There should be no access path to this from the Internet except for
developers with a VPN channel into the company network. But this is of
course not an Internet access path since the VPN effectively places
you inside the local LAN.
Access via http would probably be the simplest way to manage I
believe.

The Smart-HTTP server setup is mentioned in section 4.6 of the ProGIT
book:
https://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP

I found that Apache is already installed as part of the Raspbian
Jessie PIXEL so the install steps need not be done I assume.
However, the configuration instructions here are a bit terse so I have
not dived in there yet, need to get to know GIT better first.
But do you think it can be a working solution for us to use the web
interface? It would get a user authentication mechanism in place....


>If you are going to share your Git repositories stored on your system 
>with the public

Will never happen. We work on products that we sell and we do not
share our code...

>You mentioned you wanted to play around with Git and get to grips with 
>it - hence I suggested a local setup without the need of a RPi or some 
>other device.

Since it looked very much like a Linux thing it appeared to me to be
simpler if I had a Linux box to test on. And I have found that RPi3 is
pretty convenient.

>I always install git 
>from source code and compile it myself (like I do with FPC and Lazarus 
>too). Everything is then included - as it should be. Linux distros f*ck 
>everything up and split it into multiple packages. eg: git-core, 
>git-base, git-gui, git-subversion, git-docs etc.

I also build my FPC/Lazarus installations from svn sources since a
couple of years. But only on Linux, I have not tried it on Windows
yet.

So I really should go back to the RPi and remove the git I installed
yesterday and instead try to get the sources (via Subversion?) and
build myself then? Is it possible to get the GIT sources without GIT?

Is there some additional task to perform before running make? Like for
FPC/Lazarus I had to script the install to make sure the system was
updated with extra libraries and such before building...

>> I would very much like to have a PDF copy since I usually find that
>> easier to read than using on-line webpage versions of books.
>> Could not find the PDF though...
>
>I just had a look. The links used to be on the Table Of Contents page, 
>but for some odd reason they aren't there any more. No stress, The 
>Internet Archive always comes to the rescue.
>
>  PDF:
>    https://progit2.s3.amazonaws.com/en/2016-03-22-f3531/progit-en.1084.pdf

Thanks Graeme!
Now I have the PDF ready for off-line reading (500+ pages...)

I have additional questions regarding the way GIT works:
Handling of line endings
-------------------------
When woking on multiple platforms like Linux, Mac and Windows there
has always been a struggle to get source code line endings compatible
with the platform. Windows uses CR-LF, Mac uses CR and Linux uses LF
and in some cases if this is wrong the sources will not work.
In CVS this was managed by the CVS client such that it expanded line
endings to the platform standard whereas the repository always used
the Linux standard LF.
So if sources were transferred between systems via CVS all was fine.

Now I have read a bit about GIT and it really looks like it checksums
whole files with a 40 char hash, which is used as the key to the
files. This would make the exact same file (content wise) on Linux and
say Windows appear different with different hash values unless there
is some mechanism in GIT that handles this.
But I have not seen any mention of this yet...
And how does one specify the type of file to put in GIT? I want to
keep also some binaries there, but these invariably contain CR, LF and
CRLF byte combinations that MUST NOT be changed when moving between
platforms...
Of course some tools may have provisions for line ending invariance
but for example php code breaks on Apache if these are wrong.
Does Lazarus or FPC ignore line ending differences?

And lastly regarding CVS conversion:
------------------------------------
Since we have not used CVS in any complex way (but we do use the CVSNT
flavour on Windows), I assume that the repository files would be
possible to convert into the GIT format. After all each file contains
a history with commit messages, timestamps, tags and branches, which
are all OK.
But the organization may well consitute a problem since we have
several cases where multiple products (projects in GIT maybe) are
sharing common code via CVS modules. So the same files are used in
several places. They are stored outside project modules (folder
hierarchies) and brought in at checkout time into subdirectories of
the project source tree.
Will that complicate GIT conversion?


-- 
Bo Berglund
Developer in Sweden



More information about the fpc-other mailing list