User:Crutchy

From SoylentNews
Jump to navigation Jump to search

I'm just a regular pleb from Australia. I'm not a member of the Soylent staff.

PHP/SQL/HTML/CSS and Delphi (Object Pascal) are my preferred languages.

Look out for me on Soylent IRC (#Soylent,##,#test)

Crutchy's perl journal: http://soylentnews.org/~crutchy/journal/72

Code doc project: http://soylentnews.org/~crutchy/journal/82

slashdev journal: http://soylentnews.org/~crutchy/journal/114

Watch pages:
Development
Style
CSS Work
IRC

Git/GitHub

# apt-get install git
$ git config --global user.name "crutchy"
$ git config --global user.email ""
$ git config --global credential.helper cache
$ git config --global credential.helper 'cache --timeout=3600'

In my case /var/www/slash is served by apache2 (just on local network). This will be different if you're using the slashdev VM.

$ cd /var/www/slash

$ mkdir git
$ cd git

This creates the directory where I will keep local copies of all my git projects.

FORKING THE "slashcode" REPOSITORY

After logging into GitHub, click the fork button on the Soylent/slashcode repository github page @ https://github.com/SoylentNews/slashcode

$ cd /var/www/slash/git

Download files into a subfolder named slashcode:

$ git clone https://github.com/crutchy-/slashcode.git
$ cd slashcode

When a repository is cloned, it has a default remote called "origin" that points to your fork on GitHub, not the original repository it was forked from. To keep track of the original repository, you need to add another remote named "upstream"

$ git remote add upstream https://github.com/SoylentNews/slashcode.git

Push commits to your remote repository stored on GitHub:

$ git push

PUSHING CHANGES TO crutchy-/slashcode REMOTE REPOSITORY ON GITHUB

Add any files modified to the git commit index:

$ git add "plugins/Ajax/htdocs/images/core.js"
$ git add "themes/slashcode/templates/dispComment;misc;default"

Commit the changes to the local repository index:

git commit

Nano will open with a commented summary of indexed changes.

You must enter a commit message.

^O followed by ^X to save and close nano.

Will get something silimar to following:

[master d573b6d] collapsing/expanding comment tree. changed js function to something more generic.
 2 files changed, 13 insertions(+), 1 deletions(-)
$ git push origin master

for master branch can just d:

git push

will output something like the following:

Counting objects: 21, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 1.06 KiB, done.
Total 11 (delta 8), reused 0 (delta 0)
To https://github.com/crutchy-/slashcode.git
   98b4168..d573b6d  master -> master

CREATING A PULL REQUEST

If you want to request the changes that you've made to your fork of slashcode be merged into the upstream repository (SoylentNews/slashcode), you will need to create a pull request.

You do this from https://github.com/crutchy-/slashcode

The pull request button is a little green button to the left of the branch combo. Click it and follow the prompts.

UPSTREAM CHANGES

Fetch any new changes from the original repository:

$ git fetch upstream

Merge any changes fetched into your working files:

$ git merge upstream/master

WORKING OUTSIDE SLASHDEV VIRTUAL MACHINE

The purpose of this was to allow me to share a single local git repository on both the slashdev VM and my host machine.

I'm a perl noob, but I wanted the flexibility of being able to concurrently work on tweaking slashcode to possibly in the apache2/mod_perl2 vhost on my host machine - onfiguration details can be found here: http://soylentnews.org/~crutchy/journal/72

I also want to be able to develop changes that I can test in the VM.


From within VM, to to Devices menu and click "Shared Folder Settings...".

Create a shared machine folder (-readonly,+automount,+permanent) to the /var/www/slash/git/slashcode directory on the host machine.

In a terminal inside the VM:

$ sudo adduser slash vboxsf

Reboot VM.

Again, from a terminal inside the VM:

$ rm /srv/slashdev/slashcode
$ ln -s -T /media/sf_slashcode /srv/slashdev/slashcode

Need to make sure your VM time is set a bit ahead of your host machine time to avoid "Clock skew detected." errors when running deployslash.sh script inside the VM. I noticed that deployslash.sh script takes a little longer to finish, but does eventually finish. Tested and seems to work fine for me.


crutchy's test image