Hey,
I´ve just done the initial commit to the git repository at
sourceforge. For this I´ve done the name transition of nfblockd to
pgld and of blockcontrol to pglcmd.
But I haven´t tested anything yet! And of course there´s still lots to
improve to make them really one project. So my next aim is to test all
that stuff and make experimental Debian packages again. Then there´s
still some things I need to learn about pgld.
Generally I´d like to have a common Makefile (suggestions?) and common
docs. jimtb already told me he´s going to completely rewrite his GUI.
Well, the following is a bit long, so I´ve made a table of contents.
Basically these are the notes I made in the past. I hope it´s useful
for you :-)
1.) Introduction
2.) Getting started with git
3.) Suggestions for our collaborative work
4.) Overview of my initial checkins
5.) Howto pull nfblock and blockcontrol changes
BTW: I just started with git myself. I hope everything´s ok.
================================
1.) Introduction
Git is a distributed source code management system. It allows everyone
of us to have our own (public and/or private) repositories, and to
push and pull changes between them. Still, I think most of us will
only have their local git repository and push their changes to the one
at sourceforge.
There´s a nice user manual at
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
Further I found a cheat sheet at
http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg
With the current setup it´s also easy to develop nfblockd and
blockcontrol in parallel to pgl (it took me so long to really start
work on pgl, because I always wanted to "just" fix something small in
blockcontrol, before switching to pgl).
In git it´s no problem at all to revert any changes, so just code and
commit. Only public code is good code!
================================
2.) Getting started with git
Install git (in Debian I have the packages git-core, git-gui and gitk).
Create ~/.gitconfig with these three lines:
[user]
name = Your Name Comes Here
email = you@...
Get the code (with read-write access at sourceforge):
git clone ssh://YOURNAME@...>
Or get the code (read-only):
git clone git://peerguardian.git.sourceforge.net/gitroot/peerguardian/peerguardian
The above commands will get you the whole git repository (the whole
history) from sourceforge, and will make a checkout from HEAD of
master - this means you see directly the current code. Now just start
coding and playing ;-)
Select the changed files to commit:
git add FILENAME
git add -A (all changed files)
Commit them:
git commit
Push them to sourceforge ("origin"):
git push origin master
(it might be better to do a "git push --dry-run origin master" first,
to see what will happen)
Or make a patch:
git format-patch origin
Stay up to date (update from sourceforge and merge the sourceforge
changes to your current working environment):
git pull
Of course git offers much more functionality, see the user manual.
Never worry, it´s easy to revert any commit if it turns out to be a
bad one. With "gitk" you can easily view the history of previous
commits. Further there´s git-gui (you can prepare, review and do your
commits there).
================================
3.) Suggestions for our collaborative work
These are some thoughts that might help us to work easily together:
Commiting to the repository:
Don´t mix several changes to one commit. Keep them separated and give
useful information in the commit messages. Make separate commits for
cosmetic changes (e.g. removing blank lines and unnecessary spaces) -
they blow up the diff enormously and make it hard to read them.
Further they bear the risk to conflict with someone else´s changes, if
they were done at the same time. You can also stop your current work,
make another commit, and then resume your old work:
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#interrupted-work
Good commit messages:
Though not required, it's a good idea to begin the commit message with
a single short (less than 50 character) line summarizing the change,
followed by a blank line and then a more thorough description. Tools
that turn commits into email, for example, use the first line on the
Subject line and the rest of the commit in the body.
Documentation:
document your changes in the code, the changelog, and if
necessary in the documentation.
Coding style ("layout"):
- Don´t use tabs. Use (a multiple) of e.g. 4 spaces to indent, because
some text editors change tab to space. (I still have to change my code
for that, too.)
- Delete trailing spaces from end of each line. Otherwise some other
editor of someone else will do this, and thus bloat up diffs.
================================
4.) These are (hopefully) all steps I made to setup the git
repository, up to the state when I started to edit the files
themselves.
git clone ssh://jre-phoenix@...>
cd peerguardian
cat >.git/description <<EOF
PeerGuardian helps protect your privacy by blocking internet traffic
based on large lists of IP address ranges.
EOF
mkdir pgl
cat >>pgl/README <<EOF
This is PeerGuardian Linux (pgl).
It's based on nfblockd and blockcontrol.
EOF
git add --all
git commit -m "Initial setup"
# Initial import pgld (cf.
http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)
git remote add -f nfblockd http://kmlinux.fjfi.cvut.cz/~makovjin/nfblockd.git/
git merge --no-commit -s ours nfblockd/master
git read-tree --prefix=pgl/pgld/ -u nfblockd/master
git commit -m "Merge nfblockd from kmlinux.fjfi.cvut.cz as our
subdirectory pgl/pgld."
# Rename blockcontrol > pglcmd
cd pgl/pgld
mv dbus-nfblockd.conf dbus-pgld.conf
mv src/nfblockd.h src/pgld.h
mv src/nfblockd.c src/pgld.c
cd ../..
git add --all
git commit -m "Rename nfblockd filenames to pgld"
# Initial import pglcmd (cf.
http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)
git remote add -f blockcontrol
git://moblock-deb.git.sourceforge.net/gitroot/moblock-deb/moblock-deb
git filter-branch --subdirectory-filter blockcontrol/blockcontrol
blockcontrol/master
git merge --no-commit -s ours blockcontrol/master
git read-tree --prefix=pgl/pglcmd/ -u blockcontrol/master
git commit -m "Merge blockcontrol from moblock-deb.sourceforge.net as
our subdirectory pgl/pglcmd."
# Rename blockcontrol > pglcmd
cd pgl/pglcmd
mv blockcontrol pglcmd
mv blockcontrol.conf pglcmd.conf
mv blockcontrol.defaults pglcmd.defaults
mv blockcontrol.lib pglcmd.lib
mv blockcontrol.main pglcmd.main
mv blockcontrol.wd pglcmd.wd
mv docs/blockcontrol.1 docs/pglcmd.1
cd ../..
git add --all
git commit -m "Rename blockcontrol filenames to pglcmd"
================================
5.) Howto pull nfblock and blockcontrol changes
Pull nfblockd changes:
git pull -s subtree nfblockd master
Pull blockcontrol changes:
git fetch blockcontrol
git filter-branch -f --subdirectory-filter blockcontrol/blockcontrol
blockcontrol/master
git merge -s subtree blockcontrol/master
================================
Yay, have fun
jre
|