I've been using git for a while to manage various bits of code, it's a mixture of C/C++, Python, Bash and other bits and pieces.
For the C/C++ (and PHP now I think of it) it's fairly straightforward as the code is in a 'programming' sub-directory of my home directory and I just do a 'git init' in the root directory of the code hierarchy and off you go. Do a build, install, test and (if happy) commit the code to git.
However it gets decidedly messier for scripts where there isn't any intermediate step between writing the code and testing it or making it 'live'. Until now I had simply done a 'git init' in ~/bin and committed the code after testing. This is OK[ish] for bash scripts and some simple Python stuff but doesn't really work too well for more complex Python stuff with imported code and/or which is run by cron or other indirect means.
So, what do others here do with this sort of stuff? Do you move all the 'source' (i.e. not yet installed) code off to the 'programming' sub-directory and edit it there plus add some sort of installation script which copies all the bits to the right places for testing, or what?
.... or am I making life too complicated for myself? :-)
On 8 November 2012 11:24, Chris Green cl@isbd.net wrote:
.... or am I making life too complicated for myself? :-)
You wouldn't develop compiled code in /bin, so I'd recommend keeping scripts in the same sort of hierarchy as your source code, and then have an install script to copy them in the appropriate place.
Of course if you want to keep a history of your system changes, you could put the whole lot into a git repository ...
Tim.
On Thu, Nov 08, 2012 at 01:24:10PM +0000, Tim Green wrote:
On 8 November 2012 11:24, Chris Green cl@isbd.net wrote:
.... or am I making life too complicated for myself? :-)
You wouldn't develop compiled code in /bin, so I'd recommend keeping scripts in the same sort of hierarchy as your source code, and then have an install script to copy them in the appropriate place.
That's an idea. So my 'programming' directory has a sub-directory called bin which simply reflects exactly what's in ~/bin. Do a recursive copy to update ~/bin. That's pretty simple, thanks.
Of course if you want to keep a history of your system changes, you could put the whole lot into a git repository ...
Well they are in git repositories, just local ones.