Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 90

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Step by Step Modifying Bacula Code</TITLE>
<META NAME="description" CONTENT="Step by Step Modifying Bacula Code">
<META NAME="keywords" CONTENT="developers">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="developers.css">

<LINK REL="next" HREF="Forcing_Changes.html">
<LINK REL="previous" HREF="Git_Usage.html">
<LINK REL="up" HREF="Bacula_Git_Usage.html">
<LINK REL="next" HREF="Forcing_Changes.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html589"
  HREF="Forcing_Changes.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html583"
  HREF="Bacula_Git_Usage.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html577"
  HREF="Git_Usage.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html585"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html587"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html590"
  HREF="Forcing_Changes.html">Forcing Changes</A>
<B> Up:</B> <A NAME="tex2html584"
  HREF="Bacula_Git_Usage.html">Bacula Git Usage</A>
<B> Previous:</B> <A NAME="tex2html578"
  HREF="Git_Usage.html">Git Usage</A>
 &nbsp; <B>  <A NAME="tex2html586"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html588"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html591"
  HREF="Step_Step_Modifying_Bacula.html#SECTION00331000000000000000">More Details</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION00330000000000000000">
Step by Step Modifying Bacula Code</A>
</H1>
Suppose you want to download Bacula source code, build it, make
a change, then submit your change to the Bacula developers.  What
would you do?

<P>

<UL>
<LI>Download the Source code:
<BR><PRE>
git clone ssh://&lt;userid&gt;@bacula.git.sourceforge.net/gitroot/bacula/bacula trunk
</PRE>

<P>
</LI>
<LI>Configure and Build Bacula:
<BR><PRE>
./configure (all-your-normal-options)
make
</PRE>

<P>
</LI>
<LI>Create a branch to work on:
<PRE>
cd trunk/bacula
git checkout -b bugfix master
</PRE>

<P>
</LI>
<LI>Edit, build, Test, ...
<BR><PRE>
edit file jcr.h
make
test
</PRE>

<P>
</LI>
<LI>commit your work:
<PRE>
git commit -am "Short comment on what I did"
</PRE>

<P>
</LI>
<LI>Possibly repeat the above two items

<P>
</LI>
<LI>Switch back to the master branch:
<BR><PRE>
git checkout master
</PRE>

<P>
</LI>
<LI>Pull the latest changes:
<BR><PRE>
git pull
</PRE>

<P>
</LI>
<LI>Get back on your bugfix branch:
<BR><PRE>
git checkout bugfix
</PRE>

<P>
</LI>
<LI>Merge your changes and correct any conflicts:
<BR><PRE>
git rebase master bugfix
</PRE>

<P>
</LI>
<LI>Fix any conflicts:
<BR>
You will be notified if there are conflicts. The first
thing to do is:

<P>
<PRE>
git diff
</PRE>

<P>
This will produce a diff of only the files having a conflict.
Fix each file in turn. When it is fixed, the diff for that file
will go away. 

<P>
For each file fixed, you must do the same as SVN, inform git with:

<P>
<PRE>
git add (name-of-file-no-longer-in-conflict)
</PRE>

<P>
</LI>
<LI>When all files are fixed do:
<PRE>
git rebase --continue
</PRE>

<P>
</LI>
<LI>When you are ready to send a patch, do the following:
<BR><PRE>
git checkout bugfix
git format-patch -M master
</PRE>
Look at the files produced.  They should be numbered 0001-xxx.patch
where there is one file for each commit you did, number sequentially,
and the xxx is what you put in the commit comment.

<P>
</LI>
<LI>If the patch files are good, send them by email to the developers
as attachments.

<P>
</LI>
</UL>

<P>

<H2><A NAME="SECTION00331000000000000000">
More Details</A>
</H2>

<P>
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
create format-patch patches or push it to the Source Forge repo. Assuming
you call the Bacula repository <B>trunk</B>, you might use the following
commands:

<P>
<PRE>
cd trunk
git checkout master
git pull 
git checkout -b newbranch master
(edit, ...)
git add &lt;file-edited&gt;
git commit -m "&lt;comment about commit&gt;"
...
</PRE>

<P>
When you have completed working on your branch, you will do:

<P>
<PRE>
cd trunk
git checkout newbranch  # ensure I am on my branch
git pull                # get latest source code
git rebase master       # merge my code
</PRE>

<P>
If you have completed your edits before anyone has modified the repository,
the <B>git rebase master</B> 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:

<P>
<PRE>
git diff
</PRE>

<P>
Then edit each file that was listed in the <B>git diff</B> to remove the
conflict, which will be indicated by lines of:

<P>
<PRE>
&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
text
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
other text
=====
</PRE>

<P>
where <B>text</B> is what is in the Bacula repository, and <B>other text</B>
is what you have changed.

<P>
Once you have eliminated the conflict, the <B>git diff</B> will show nothing,
and you must do a:

<P>
<PRE>
git add &lt;file-with-conflicts-fixed&gt;
</PRE>

<P>
Once you have fixed all the files with conflicts in the above manner, you enter:

<P>
<PRE>
git rebase --continue
</PRE>

<P>
and your rebase will be complete.

<P>
If for some reason, before doing the -continue, you want to abort the rebase and return to what you had, you enter:

<P>
<PRE>
git rebase --abort
</PRE>

<P>
Finally to make a set of patch files

<P>
<PRE>
git format-patch -M master
</PRE>

<P>
When you see your changes have been integrated and pushed to the
main repo, you can delete your branch with:

<P>
<PRE>
git checkout master
git branch -D newbranch
</PRE>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html589"
  HREF="Forcing_Changes.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html583"
  HREF="Bacula_Git_Usage.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html577"
  HREF="Git_Usage.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html585"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html587"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html590"
  HREF="Forcing_Changes.html">Forcing Changes</A>
<B> Up:</B> <A NAME="tex2html584"
  HREF="Bacula_Git_Usage.html">Bacula Git Usage</A>
<B> Previous:</B> <A NAME="tex2html578"
  HREF="Git_Usage.html">Git Usage</A>
 &nbsp; <B>  <A NAME="tex2html586"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html588"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>