]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manuals/es/developers/generaldevel.tex
Update git pointers
[bacula/docs] / docs / manuals / es / developers / generaldevel.tex
index 098ec143c67817dc596df6bd58d2817bd241a41b..74a8a2a46f2879d9c99a05409a8c5dddf8900c8b 100644 (file)
@@ -8,22 +8,22 @@
 \addcontentsline{toc}{section}{Bacula Developer Notes}
 
 This document is intended mostly for developers and describes how you can
-contribute to the Bacula project and the the general
-framework of making Bacula source changes. 
+contribute to the Bacula project and the the general framework of making
+Bacula source changes.
 
 \subsection{Contributions}
 \index{Contributions}
 \addcontentsline{toc}{subsubsection}{Contributions}
 
 Contributions to the Bacula project come in many forms: ideas,
-participation in helping people on the bacula-users email list, 
-packaging Bacula binaries for the community, helping improve
-the documentation, and submitting code.
+participation in helping people on the bacula-users email list, packaging
+Bacula binaries for the community, helping improve the documentation, and
+submitting code.
 
 Contributions in the form of submissions for inclusion in the project are
 broken into two groups.  The first are contributions that are aids and not
-essential to Bacula.  In general, these will be scripts or will go into and
-examples or contributions directory.  For these kinds of non-essential
+essential to Bacula.  In general, these will be scripts or will go into the
+{\bf bacula/examples} directory.  For these kinds of non-essential
 contributions there is no obligation to do a copyright assignment as
 described below.  However, a copyright assignment would still be
 appreciated.
@@ -40,10 +40,18 @@ The following text describes some of the requirements for such code.
 
 Subject to the copyright assignment described below, your patches should be
 sent in {\bf diff -u} format relative to the current contents of the Source
-Forge SVN.  The diff -u format is the easiest for us to understand and integrate.
-Please be sure to use the Bacula indenting standard (see below) for source code.
-If you have checked out the source with SVN, you can get a diff using:
+Forge GIT repository or SVN repository.  The diff -u format is the easiest
+for us to understand and integrate.  Please be sure to use the Bacula
+indenting standard (see below) for source code.  If you have checked out
+the source with GIT or SVN, you can get a diff using.
 
+For the bacula, gui, and regress directories:
+\begin{verbatim}
+git pull
+git diff >change.patch
+\end{verbatim}
+
+For the docs or rescue directories:
 \begin{verbatim}
 svn update 
 svn diff > change.patch
@@ -51,8 +59,8 @@ svn diff > change.patch
      
 If you plan on doing significant development work over a period of time,
 after having your first patch reviewed and approved, you will be eligible
-for having developer SVN write access so that you can commit your changes
-directly to the SVN repository.  To do so, you will need a userid on Source
+for having developer GIT or SVN write access so that you can commit your changes
+directly to the GIT or SVN repository.  To do so, you will need a userid on Source
 Forge.
 
 \subsection{Copyrights}
@@ -63,22 +71,23 @@ To avoid future problems concerning changing licensing or
 copyrights, all code contributions more than a hand full of lines
 must be in the Public Domain or have the copyright transferred to
 the Free Software Foundation Europe e.V. with a Fiduciary License
-Agreement (FLA) as in the current code.  Note, prior to
-November 2004, the code was copyrighted by Kern Sibbald and John
-Walker.  After November 2004, the code was copyrighted by Kern
-Sibbald, then on the 15th of November 2006, the copyright was
-transferred to the Free Software Foundation Europe e.V.
-In signing the FLA and transferring the copyright, you retain the
-right to use the code you have submitted as you want.
+Agreement (FLA) as the case for all the current code.  
+
+Prior to November 2004, all the code was copyrighted by Kern Sibbald and
+John Walker.  After November 2004, the code was copyrighted by Kern
+Sibbald, then on the 15th of November 2006, Kern transferred the copyright
+to the Free Software Foundation Europe e.V. In signing the FLA and
+transferring the copyright, you retain the right to use the code you have
+submitted as you want, and you ensure that Bacula will always remain Free
+and Open Source.
 
 Your name should be clearly indicated as the author of the code, and you
-must be extremely careful not to violate any copyrights or patents or use other
-people's code without acknowledging it.  The purpose of this requirement is
-to avoid future copyright, patent, or intellectual property problems.  
-Please read the LICENSE agreement in the main Bacula source code
-directory.  When you sign the Fiduciary License Agreement (FLA)
-and send it in, you are argeeing to the terms of that LICENSE
-file.
+must be extremely careful not to violate any copyrights or patents or use
+other people's code without acknowledging it.  The purpose of this
+requirement is to avoid future copyright, patent, or intellectual property
+problems.  Please read the LICENSE agreement in the main Bacula source code
+directory.  When you sign the Fiduciary License Agreement (FLA) and send it
+in, you are agreeing to the terms of that LICENSE file.
 
 If you don't understand what we mean by future problems, please
 examine the difficulties Mozilla was having finding
@@ -96,7 +105,7 @@ unusual, but in reality, it is not.  Most large projects require
 this.
 
 If you have any doubts about this, please don't hesitate to ask.  The
-objective is to assure the long term servival of the Bacula project. 
+objective is to assure the long term survival of the Bacula project. 
 
 Items not needing a copyright assignment are: most small changes,
 enhancements, or bug fixes of 5-10 lines of code, which amount to    
@@ -155,17 +164,20 @@ to confirm reception of the signed FLA.
 \index{Cycle!Developement}
 \addcontentsline{toc}{subsubsection}{Development Cycle}
 
-As I noted in the 1.38 ReleaseNotes, version 1.38 was different from prior
-versions because it had a lot more contributions.  We expect that this trend
+As I noted in previous emails the number of contributions are
+increasing significantly.  We expect this positive trend
 will continue.  As a consequence, we have modified how we do
 development, and instead of making a list of all the features that we will
-implement in the next version, each developer will sign up for one (maybe
-two) projects at a time, and when they are complete, we will release a new
-version.
+implement in the next version, each developer signs up for one (maybe
+two) projects at a time, and when they are complete, and the code
+is stable, we will release a new version.  The release cycle will probably
+be roughly six months.
 
-The difference is that we will have more time to review the new code that is
-being contributed, and will be able to devote more time to a smaller number
-of projects (1.38 had too many new features for us to handle correctly).
+The difference is that with a shorter release cycle and fewer released
+feature, we will have more time to review the new code that is being
+contributed, and will be able to devote more time to a smaller number of
+projects (some prior versions had too many new features for us to handle
+correctly).
 
 Future release schedules will be much the same, and the
 number of new features will also be much the same providing that the
@@ -173,26 +185,27 @@ contributions continue to come -- and they show no signs of let up :-)
 
 \index{Feature Requests}
 {\bf Feature Requests:} \\
-In addition, we would like to "formalize" the feature requests a bit.
+In addition, we have "formalizee" the feature requests a bit.
 
 Instead of me maintaining an informal list of everything I run into 
-(kernstodo), we would like to maintain a "formal" list of projects.  This 
+(kernstodo), we now maintain a "formal" list of projects.  This 
 means that all new feature requests, including those recently discussed on 
 the email lists, must be formally submitted and approved. 
 
 Formal submission of feature requests will take two forms: \\
 1. non-mandatory, but highly recommended is to discuss proposed new features
 on the mailing list.\\
-2.  Formal submission of an Feature Request in a special format.
-We'll give an example of this below, but you can also find it on the web
-site under "Support -\gt{} Feature Requests".  Since it takes a bit of time to
-properly fill out a Feature Request form, you probably should check on the email list
-first.
+2.  Formal submission of an Feature Request in a special format.  We'll
+give an example of this below, but you can also find it on the web site
+under "Support -\gt{} Feature Requests".  Since it takes a bit of time to
+properly fill out a Feature Request form, you probably should check on the
+email list first.
 
 Once the Feature Request is received by the keeper of the projects list, it
 will be sent to the Bacula project manager (Kern), and he will either
-accept it, send it back asking for clarification, send it to the email list
-asking for opinions, or reject it.
+accept it (90% of the time), send it back asking for clarification (10% of
+the time), send it to the email list asking for opinions, or reject it
+(very few cases).
 
 If it is accepted, it will go in the "projects" file (a simple ASCII file) 
 maintained in the main Bacula source directory.
@@ -210,9 +223,9 @@ accepted.  \\
 difficult that we cannot imagine finding someone to implement probably won't
 be accepted. Obviously if you know how to implement it, don't hesitate
 to put it in your Feature Request  \\
- 3.  whether or not the Feature Request fits within the
-current stategy of Bacula (for example an Feature Request that requests changing the
-tape to tar format probably would not be accepted, ...).
+ 3.  whether or not the Feature Request fits within the current strategy of
+Bacula (for example an Feature Request that requests changing the tape to
+tar format probably would not be accepted, ...).
 
 {\bf How Feature Requests are prioritized:}\\
 Once an Feature Request is accepted, it needs to be implemented.  If you
@@ -289,7 +302,8 @@ Getting code implemented in Bacula works roughly as follows:
 
 \item Kern is the project manager, but prefers not to be a "gate keeper".
       This means that the developers are expected to be self-motivated,
-      and once they have experience submit directly to the SVN.  However,
+      and once they have experience submit directly to the GIT or SVN
+      repositories. However,
       it is a good idea to have your patches reviewed prior to submitting,
       and it is a bad idea to submit monster patches because no one will
       be able to properly review them. See below for more details on this.
@@ -306,7 +320,7 @@ Getting code implemented in Bacula works roughly as follows:
    document it in the code, document it in the manual (even though
    their mother tongue is not English), test it, develop and commit
    regression scripts, and answer in a timely fashion all bug reports --
-   even occassionally accepting additional bugs :-)
+   even occasionally accepting additional bugs :-)
 
    This is a sustainable way of going forward with Bacula, and the
    direction that the project will be taking more and more.  For
@@ -315,11 +329,12 @@ Getting code implemented in Bacula works roughly as follows:
    programmers due to outside obligations (job responsibilities change of
    job, school duties, ...) could not continue to maintain the code.  In
    those cases, the code suffers from lack of maintenance, sometimes we
-   patch it, sometimes not.  In the end, the code gets dropped from the
-   project (there are two such contributions that are heading in that
-   direction).  When ever possible, we would like to avoid this, and 
-   ensure a continuation of the code and a sharing of the development,
-   debugging, documentation, and maintenance responsibilities.
+   patch it, sometimes not.  In the end, if the code is not maintained, the
+   code gets dropped from the project (there are two such contributions
+   that are heading in that direction).  When ever possible, we would like
+   to avoid this, and ensure a continuation of the code and a sharing of
+   the development, debugging, documentation, and maintenance
+   responsibilities.
 \end{itemize}
 
 \section{Patches for Released Versions}
@@ -344,7 +359,7 @@ follows:
   (input description)
   (end edit)
 
-   svn diff >>2.2.4-restore.patch
+   git diff >>2.2.4-restore.patch
 \end{verbatim}
 
 check to make sure no extra junk got put into the patch file (i.e.
@@ -353,7 +368,7 @@ it should have the patch for that bug only).
 If there is not a bug report on the problem, create one, then add the
 patch to the bug report. 
 
-Uthen upload it to the 2.2.x release of bacula-patches.
+Then upload it to the 2.2.x release of bacula-patches.
 
 So, end the end, the patch file is:
 \begin{itemize}
@@ -369,17 +384,241 @@ So, end the end, the patch file is:
 \end{itemize}
 
 
+\section{Bacula GIT and SVN repositories}
+\index{GIT and SVN}
+\addcontentsline{toc}{subsection}{GIT and SVN repositories}
+As of August 2009, the Bacula source code has been split into
+two repositories.  One is a GIT repository that holds the
+main Bacula source code with directories {\bf bacula}, {\bf gui},
+and {\bf regress}.  The second repository (SVN) contains
+the directories {\bf rescue} and {\bf docs}. Both repositories are 
+hosted on Source Forge.
+
+Previously everything was in a single SVN repository.
+We have split the SVN repository into two because GIT
+offers significant advantages for ease of managing and integrating
+developer's changes.  However, one of the disadvantages of GIT is that you
+must work with the full repository, while SVN allows you to checkout
+individual directories.  If we put everything into a single GIT
+repository it would be far bigger than most developers would want
+to checkout, so we have left the docs and rescue in the old SVN
+repository, and moved only the parts that are most actively 
+worked on by the developers (bacula, gui, and regress) to a GIT
+repository.  
+
+Unfortunately, Bacula developers must now have a certain knowledege
+of both GIT and SVN, and if you are a core Bacula developer knowledge of
+GIT is particularly important.
+
+\section{GIT Usage}
+\index{GIT Usage}
+\addcontentsline{toc}{subsection}{GIT Usage}
+
+Please note that if you are familiar with SVN, GIT is similar,
+(and better), but there can be a few surprising differences that
+can lead to damaging the history of the repository (repo) if
+you attempt to force pushing data into the GIT repo.
+
+The GIT repo contains the subdirectories {\bf bacula}, {\bf gui},
+and {\bf regress}. With GIT it is not possible to pull only a
+single directory, because of the hash code nature of git, you
+must take all or nothing.
+
+For developers, the most important thing to remember about GIT and
+the Source Forge repository is not to "force" a {\bf push} to the
+repository, and not to use the {\bf rebase} command on the {\bf
+master} branch of the repository.  Doing so, will possibly rewrite
+the GIT repository history and cause a lot of problems for the 
+project.
+
+You may and should use {\bf rebase} on your own branches that you
+want to synchronize with the {\bf master} branch, but please
+do not use {\bf rebase} on the {\bf master} branch.  The proper
+way of merging changes will be discussed below.
+
+You can get a full copy of the Source Forge Bacula GIT repository with the
+following command:
+
+\begin{verbatim}
+git clone git://bacula.git.sourceforge.net/gitroot/bacula/bacula trunk
+\end{verbatim}
+
+This will put a read-only copy into the directory {\bf trunk} 
+in your current directory, and {\bf trunk} will contain
+the subdirectories: {\bf bacula}, {\bf gui}, and {\bf regress}.
+
+If you have write permission, you can get a copy of the GIT
+repo with:
+
+\begin{verbatim}
+git clone ssh://<userid>@bacula.git.sourceforge.net/gitroot/bacula/bacula trunk
+\end{verbatim}
+
+where you replace \verb+<userid>+ with your Source Forge login 
+userid, and you must have previously uploaded your public ssh key
+to Source Forge.
+
+The above command needs to be done only once. Thereafter, you can:
+
+\begin{verbatim}
+cd trunk
+git pull origin
+\end{verbatim}
+
+As of August 2009, the size of the repository ({\bf trunk} in the above
+example) will be approximately 55 Megabytes.  However, if you build
+from source in this directory and do a lot of updates and regression
+testing, the directory could become several hundred megabytes.
+
+\subsection{Learning GIT}
+\index{Learning GIT}
+If you want to learn more about GIT, we recommend that you visit:\\
+\elink{http://book.git-scm.com/}{http://book.git-scm.com/}.
+
+
+\subsection{Publishing your changes}
+\index{Publishing}
+Since GIT is more complex than SVN, it takes a bit of time to learn how
+to use it properly, and if you are not careful, you can potentially create
+a new history in the repository. In addition, since GIT is a distributed 
+version control system, we prefer to receive a full branch submission rather
+than simply a patch.  To accomplish this, you must create your changes in
+a branch, then {\bf push} them to some public repository -- it can be your
+own repository that you publish or another.  To simplify this phase for you, we
+have created a publich Bacula GIT repository on {\bf github} where you can
+push your branch containing changes you would like integrated into the Bacula
+source code.
+
+Once you have pushed your branch to {\bf github} or told us where we can pull
+from your public repository, one of the senior Bacula devlopers will fetch your 
+changes, examine them, possibly make comments for changes they would like to
+see, and as the final step, the senior developer will commit it to the
+Bacula Source Forge GIT repository.
+
+\subsection{Github}
+\index{github}
+If you are going to submit before cloning the Bacula Github database, you must create a login on
+the Github website:\\
+\elink{http://github.com/}{http://github.com/}\\
+You must also upload your public ssh key. Please see the instructions
+at the above link.  Then you notify one of the senior Bacula developers,
+who will add your Github user name to the Bacula repository. Finally,
+you clone the Bacula repository with:
+
+\begin{verbatim}
+ git clone git@github.com:<username>/bacula.git <xxx>
+\end{verbatim}
+
+where you replace \verb+<username>+ with the User Name that you created
+when you created your Github login, and you replace \verb+<xxx>+ with the name
+of a directory that you want git to create to hold your local Bacula git
+repository.
+
+Normally, you will work by creating a branch of the master branch of your
+repository, make your modifications, then make sure it is up to date, and finally
+push it to Github. Assuming you call the Bacula repository {\bf bacula}, you might
+use the following commands:
+
+\begin{verbatim}
+cd bacula
+git checkout master
+git pull 
+git branch <your-name>/newbranch
+git checkout <your-name>/newbranch
+(edit, ...)
+git add <file-edited>
+git commit -m "<comment about commit>"
+...
+\end{verbatim}
+
+Note, we request you to create the branch name with your github
+login name. This guarantees that the branch name will be unique and
+easily identified as well.
+
+When you have completed working on your branch, you will do:
+
+\begin{verbatim}
+cd bacula
+git checkout <your-name>/newbranch
+git pull
+git rebase master
+\end{verbatim}
+
+If you have completed your edits before anyone has modified the repository,
+the {\bf git rebase master} will report that there was nothing to do. Otherwise,
+it will merge the changes that were made in the repository before your changes.
+If there are any conflicts, git will tell you. Typically resolving conflicts with
+git is relatively easy.  You simply make a diff:
+
+\begin{verbatim}
+git diff
+\end{verbatim}
+
+Then edit each file that was listed in the {\bf git diff} to remove the
+conflict, which will be indicated by lines of:
+
+\begin{verbatim}
+<<<<<<< HEAD
+text
+>>>>>>>>
+other text
+=====
+\end{verbatim}
+
+where {\bf text} is what is in the Bacula repository, and {\bf other text}
+is what you have changed.
+
+Once you have eliminated the conflict, the {\bf git diff} will show nothing,
+and you must do a:
+
+\begin{verbatim}
+git add <file-with-conflicts-fixed>
+\end{verbatim}
+
+Once you have fixed all the files with conflicts in the above manner, you enter:
+
+\begin{verbatim}
+git rebase --continue
+\end{verbatim}
+
+and your rebase will be complete.
+
+If for some reason, before doing the --continue, you want to abort the rebase and return to what you had, you enter:
+
+\begin{verbatim}
+git rebase --abort
+\end{verbatim}
+
+Finally to upload your branch, you do:
+
+\begin{verbatim}
+git push origin <your-name>/newbranch
+\end{verbatim}
+
+If you wish to delete it later, you can use:
+
+\begin{verbatim}
+git push origin :<your-name>/newbranch
+\end{verbatim}
+
+
 
 \section{SVN Usage}
 \index{SVN Usage}
 \addcontentsline{toc}{subsection}{SVN Usage}
 
-Please note that if you are familar with CVS, SVN is very
+Note: this section is somewhat out of date, since the SVN now
+contains only the docs and rescue subdirectories.  The bacula,
+gui, and regress directories are now maintained in a GIT
+repository.
+
+Please note that if you are familiar with CVS, SVN is very
 similar (and better), but there can be a few surprising
 differences.
 
-The *entire* Bacula  SourceForge.net Subversion repository can be
-checked out through SVN with the following command:
+The Bacula  SourceForge.net Subversion repository that contains
+the documentation and the rescue scripts checked out through SVN with the
+following command:
 
 \begin{verbatim}
 svn checkout https://bacula.svn.sourceforge.net/svnroot/bacula bacula
@@ -442,15 +681,12 @@ periods (e.g. 2.0, 2.0.1, ...).
 
 In addition all tags even those that you create are read-only
 forever. Typically tags represent release points either in the
-trunc or in a branch.
+trunk or in a branch.
 
 
 Coming back to getting source code. 
-If you only want the current Bacula source code, you could use:
-
-\begin{verbatim}
-svn checkout https://bacula.svn.sourceforge.net/svnroot/bacula/trunk/bacula bacula
-\end{verbatim}
+If you only want the current Bacula source code, you should see
+the above section that describes the GIT repository.
 
 To view what is in the SVN, point your browser at the following URL:
 http://bacula.svn.sourceforge.net/viewvc/bacula/  
@@ -1434,5 +1670,3 @@ politely send the user to the Feature Request menu item on www.bacula.org.
 The same applies to a support request (we answer only bugs), you might give
 the user a tip, but please politely refer him to the manual and the
 Getting Support page of www.bacula.org.
-
-