[fpc-other] GIT versioning server on Raspberry Pi?
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Wed May 31 16:13:51 CEST 2017
On 2017-05-31 09:58, Bo Berglund wrote:
> Aplogies if my postings are a bit longish,
You are like me then. :) I try to write shorter messages, but often fail.
> Access via http would probably be the simplest way to manage I
> believe.
I actually found Gitolite the simplest (which uses SSH and manages its
own user accounts and access) - independent of the operating system user
accounts. So I highly recommend you look into that.
The Git Daemon is also very very straightforward, but doesn’t offer much
in the form of security.
I try not to use HTTP for Git if I can - it’s the slowest protocol for
use with Git. It’s like fitting a square peg in a round hole. With a big
enough hammer it WILL fit, but not ideal. ;-)
> 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.
I use near identical scripts on both platforms. So not any more difficult.
> build myself then? Is it possible to get the GIT sources without GIT?
Yes, FreeBSD’s Ports system does that. It downloads a *.tar.xz archive
of the latest release, then builds it locally.
> 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.
I believe the default behaviour is for each platform to have native EOL
styles, after you cloned a repository. Internally, git stores files in a
set EOL style (Unix-style I believe) on all platforms.
But some people like Linus Torvalds will tell you that technically a SCM
system should *not* modify files at all, so that what you put in is
exactly what you’ll get out. Git obviously supports this model too.
> 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.
Git handles that, and there will be no difference between that same
patch being applied under Linux or Windows. The commit SHA1 should be
identical. Git magic I guess. ;-)
> 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...
You can create a ".gitattributes" file in the root of your git
repository. You can then specify which files should be treated as binary
data, which diff algorithm should be used, and which files should have
specific EOL styles. See the fpGUI repository as an example.
=======================[ .gitattribute ]=======================
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
# Explicitly set some EOL styles and preferred diff style
*.pas text diff=pascal
*.lpr text diff=pascal
*.pp text diff=pascal
*.inc text diff=pascal
*.txt text
*.xpm text
*.ods diff=odf
*.odt diff=odf
*.odp diff=odf
# declare files that must always have specific EOL style
*.dez text eol=crlf
# True binary files that should not be modified (just for safety sake)
*.jpg binary
*.png binary
*.bmp binary
*.inf binary
*.INF binary
*.zip binary
*.res binary
*.tar.gz binary
*.wav binary
*.pdf binary
===============================================================
> 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.
I haven't used CVS in over 20 years easily. I know there is a CVS-to-Git
conversion support, just like there is for SubVersion, Mercurial and
Perforce, but I've only [personally] done SubVersion conversions.
I unfortunately don't know the details of what you ask. I'm sure a
Internet search or the Git man pages will help you further.
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-other
mailing list