1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>The Git Repository</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
<link rel="HOME" title="Privoxy Developer Manual" href="index.html">
<link rel="PREVIOUS" title="Introduction" href="introduction.html">
<link rel="NEXT" title="Documentation Guidelines" href="documentation.html">
<link rel="STYLESHEET" type="text/css" href="../p_doc.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th colspan="3" align="center">Privoxy Developer Manual</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href="introduction.html" accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom"></td>
<td width="10%" align="right" valign="bottom"><a href="documentation.html" accesskey="N">Next</a></td>
</tr>
</table>
<hr align="left" width="100%">
</div>
<div class="SECT1">
<h1 class="SECT1"><a name="GIT" id="GIT">2. The Git Repository</a></h1>
<p>If you become part of the active development team, you will eventually need write access to our holy grail, the
Git repository. One of the team members will need to set this up for you. Please read this chapter completely
before accessing via Git.</p>
<div class="SECT2">
<h2 class="SECT2"><a name="GITACCESS" id="GITACCESS">2.1. Access to Git</a></h2>
<p>The project's Git repository is hosted on the <a href="https://www.privoxy.org/" target="_top">Privoxy
webserver</a>. For Privoxy team members with push privileges the Git repository URL is <tt class=
"LITERAL">ssh://git@git.privoxy.org:23/git/privoxy.git</tt>.</p>
<p>Contributors without push privileges can <span class="QUOTE">"git clone
https://www.privoxy.org/git/privoxy.git"</span>.</p>
<p>The central repository is called <tt class="LITERAL">privoxy</tt>, and the source branch is called <tt class=
"LITERAL">master</tt>. Subfolders exist within the project for target-dependent build and packaging tools, each
including the name of the target operating system in their name (e.g. Windows, OSXPackageBuilder, debian). There
is a webview of the Git hierarchy at <a href="https://www.privoxy.org/gitweb/?p=privoxy.git;a=tree" target=
"_top">https://www.privoxy.org/gitweb/?p=privoxy.git;a=tree</a>, which might help with visualizing how these
pieces fit together.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><a name="GITBRANCHES" id="GITBRANCHES">2.2. Branches</a></h2>
<p>Whilst the central repository contains only the master branch, developers are of course free to create
branches in their local repositories as they develop features, fixes, or update the target-dependent tools. Only
once such changes are fully tested ought they be pushed back to the central repository master branch.</p>
<p>Before pushing stuff, please rebase it on a current master so we get an uncomplicated commit history. Avoid
merges where possible.</p>
<p>Here's an example git sesssion that should result in a merge-free history:</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="PROGRAMLISTING"> fk@t520 ~/git/privoxy $git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
# Make sure you have the latest changes
fk@t520 ~/git/privoxy $git pull
Already up to date.
# Create a local banch for changes
fk@t520 ~/git/privoxy $git checkout -b local-branch
Switched to a new branch 'local-branch'
# Create some change
fk@t520 ~/git/privoxy $gmake dok dok-tidy
[...]
# Review your change
fk@t520 ~/git/privoxy $git diff
[...]
# Commit your changes if they look goood
fk@t520 ~/git/privoxy $git commit -m "developer-manual: Regenerate" doc/webserver/
[local-branch 1abb7316] developer-manual: Regenerate
1 file changed, 2 insertions(+), 2 deletions(-)
# Review your commit
fk@t520 ~/git/privoxy $git show
[...]
# Go to the master branch
fk@t520 ~/git/privoxy $git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
# Make sure you are still in sync
fk@t520 ~/git/privoxy $git pull
[...]
Already up to date.
# Apply the commit you made to the local-branch
fk@t520 ~/git/privoxy $git cherry-pick local-branch
[master 046e85e2] developer-manual: Regenerate
Date: Tue Dec 15 05:10:07 2020 +0100
1 file changed, 2 insertions(+), 2 deletions(-)
# Make sure the history looks as expected
fk@t520 ~/git/privoxy $git log -p
# Finally push your change to the Privoxy repository
fk@t520 ~/git/privoxy $git push
[...]
# Go back to the local branch
fk@t520 ~/git/privoxy $git checkout local-branch
# Rebase on top of master and continue hacking
fk@t520 ~/git/privoxy $git rebase master
Successfully rebased and updated refs/heads/local-branch.</pre>
</td>
</tr>
</table>
<p>At one time there were two distinct branches: stable and unstable. The more drastic changes were to be in the
unstable branch. These branches have now been merged to minimize time and effort of maintaining two branches.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><a name="GITCOMMIT" id="GITCOMMIT">2.3. Git Commit Guidelines</a></h2>
<p>The source tree is the heart of every software project. Every effort must be made to ensure that it is
readable, compilable and consistent at all times. We expect anyone with Git access to strictly adhere to the
following guidelines:</p>
<p>Basic Guidelines, for all branches:</p>
<ul>
<li>
<p>Please don't commit even a small change without testing it thoroughly first. When we're close to a public
release, ask a fellow developer to review your changes.</p>
</li>
<li>
<p>Your commit message should give a concise overview of <span class="emphasis"><i class="EMPHASIS">what you
changed</i></span> (no big details) and <span class="emphasis"><i class="EMPHASIS">why you changed
it</i></span> Just check previous messages for good examples.</p>
</li>
<li>
<p>Don't use the same message on multiple files, unless it equally applies to all those files.</p>
</li>
<li>
<p>If your changes span multiple files, and the code won't recompile unless all changes are committed (e.g.
when changing the signature of a function), then commit all files one after another, without long delays in
between. If necessary, prepare the commit messages in advance.</p>
</li>
<li>
<p>Before changing things on Git, make sure that your changes are in line with the team's general consensus
on what should be done.</p>
</li>
<li>
<p>Note that near a major public release, we get more cautious. There is always the possibility to submit a
patch to the <a href="https://sourceforge.net/p/ijbswa/patches/" target="_top">patch tracker</a> or the
<a href="https://lists.privoxy.org/mailman/listinfo/privoxy-devel" target="_top">privoxy-devel mailing
list</a> instead.</p>
</li>
</ul>
</div>
</div>
<div class="NAVFOOTER">
<hr align="left" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="introduction.html" accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="documentation.html" accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Introduction</td>
<td width="34%" align="center" valign="top"> </td>
<td width="33%" align="right" valign="top">Documentation Guidelines</td>
</tr>
</table>
</div>
</body>
</html>
|