From Fedora Project Wiki

m (Minor changes)
m (Add named branch instructions from wwoods)
Line 1: Line 1:
= Checkout The Code =
+
= Getting started =
  
It's always easier if you start from a git checkout, as git makes it very easy to do patches.   You won't have to run "patch" manually and stuff like that, nor will you have to maintain a separate tree.
+
This page details the patch process for the [[AutoQA]] project.  Before you do anything else ... you'll need to install {{package|git}}.
  
 
<pre>
 
<pre>
 
yum install git
 
yum install git
 +
</pre>
 +
 +
= The basics =
 +
 +
== Checkout The Code ==
 +
 +
It's always easier if you start from a fresh git clone, as git makes it very easy to do patches.  You won't have to run "patch" manually and stuff like that, nor will you have to maintain a separate tree.
 +
 +
<pre>
 
git clone git://git.fedorahosted.org/autoqa.git
 
git clone git://git.fedorahosted.org/autoqa.git
 
</pre>
 
</pre>
  
= Keeping In Sync =
+
== Keep In Sync ==
  
 
If you want to update your checkout to the latest git source, from any branch:
 
If you want to update your checkout to the latest git source, from any branch:
  
 
<pre>
 
<pre>
cd autoqa
 
 
git fetch origin
 
git fetch origin
 
git rebase origin/master
 
git rebase origin/master
 
</pre>
 
</pre>
  
= What Changed? =
+
== What Changed? ==
  
 
Now, make your changes. To see the differences you've made since last commit:
 
Now, make your changes. To see the differences you've made since last commit:
Line 24: Line 32:
 
<pre>git diff HEAD</pre>
 
<pre>git diff HEAD</pre>
  
At any time when you want to stay up to date with what's going on in the main repo you can do the fetch/rebase step as many times as you want.  This makes all your changes be modified
+
At any time when you want to stay up to date with what's going on in the main repo you can do the fetch/rebase step as many times as you want.  This makes all your changes be modified as if they were applied to the latest on the remote branch.
as if they were applied to the latest on the remote branch.
 
  
= Oops, How do I Revert? =
+
== Oops, How do I Revert? ==
  
 
To revert your changes:
 
To revert your changes:
Line 35: Line 42:
 
</pre>
 
</pre>
  
= Submitting Patches For Review =
+
== Patch submission ==
 
 
Once you have the checkout working like you want, generate a list of patches and submit for review to autoqa-devel@lists.fedorahosted.org. 
 
 
 
Record all the changes:
 
 
 
<pre> git commit -a </pre>
 
 
 
Generate a list of patches between your local checkout and a remove branch called ''origin/master'', type:
 
  
<pre>git format-patch origin/master</pre>
+
Once you have the checkout working like you want, you can generate a list of patches and submit for review to autoqa-devel@lists.fedorahosted.org.  The procedure is detailed below.
  
This will output a list of one or more patches that can be downloaded and applied by developers with "git am".
+
# First, be sure to commit all the changes locally:
 +
#:<pre>git commit -a </pre>
 +
# Next, generate a list of patches between your local checkout and a remove branch called ''origin/master'', type:
 +
#: <pre>git format-patch origin/master</pre> 
 +
#:This will output a list of one or more patches that can be downloaded and applied by developers using the command {{command|git am}}.
 +
# Now, write a high level summary of your changes:
 +
#: <pre>
 +
#: cat <<EOF> msg
 +
#: Subject: My favorite patches
 +
#:
 +
#: Hello,
 +
#:
 +
#: Included are several packages which implement feature X and have been thoroughly tested.
 +
#:
 +
#: Thanks!
 +
#: EOF</pre>
 +
# Finally, send the patches along with the descriptive summary to ''autoqa-devel@lists.fedorahosted.org'' for review:
 +
#: <pre>
 +
#: yum install git-email
 +
#: git send-email --no-chain-reply-to --quiet --to autoqa-devel@lists.fedorahosted.org msg *.patch</pre>
  
Now, write a high level summary of your changes:
+
= Named Branch =
  
<pre>
+
If you are developing a feature or working on a rather large patchset for [[AutoQA]], you are recommended to create a named branch to work from.  This makes patch submission and merging easier for the [[AutoQA]] maintainers. 
cat <<EOF> msg
 
Subject: My favorite patches
 
  
Hello,
+
To create and share a named branch ...
  
Included are several packages which implement feature X and have been thoroughly tested.
+
# Create a new branch locally, based on current branch (master)
 
+
#: <pre>
Thanks!
+
#: git checkout -b myusername</pre>
EOF
+
# Now, share your branch by pushing it into the remote repo
</pre>
+
#: <pre>
 
+
#: git push --all</pre>
Finally, send these patches to ''autoqa-devel@lists.fedorahosted.org'' for review:
+
# Finally, configure the local repo to merge with the remote so ''git pull'' works
 
+
#: <pre>
<pre>
+
#: git config branch.myusername.remote origin
yum install git-email
+
#: git config branch.myusername.merge refs/heads/myusername</pre>
git send-email --no-chain-reply-to --quiet --to autoqa-devel@lists.fedorahosted.org msg *.patch
 
</pre>
 
  
 
= References =
 
= References =
  
 
* http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
 
* http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
 +
 
[[Category:AutoQA]]
 
[[Category:AutoQA]]

Revision as of 21:24, 2 February 2010

Getting started

This page details the patch process for the AutoQA project. Before you do anything else ... you'll need to install Package-x-generic-16.pnggit.

yum install git

The basics

Checkout The Code

It's always easier if you start from a fresh git clone, as git makes it very easy to do patches. You won't have to run "patch" manually and stuff like that, nor will you have to maintain a separate tree.

git clone git://git.fedorahosted.org/autoqa.git

Keep In Sync

If you want to update your checkout to the latest git source, from any branch:

git fetch origin
git rebase origin/master

What Changed?

Now, make your changes. To see the differences you've made since last commit:

git diff HEAD

At any time when you want to stay up to date with what's going on in the main repo you can do the fetch/rebase step as many times as you want. This makes all your changes be modified as if they were applied to the latest on the remote branch.

Oops, How do I Revert?

To revert your changes:

git checkout -f                     # All changes
git checkout -f autoqa.spec         # A specific file

Patch submission

Once you have the checkout working like you want, you can generate a list of patches and submit for review to autoqa-devel@lists.fedorahosted.org. The procedure is detailed below.

  1. First, be sure to commit all the changes locally:
    git commit -a 
  2. Next, generate a list of patches between your local checkout and a remove branch called origin/master, type:
    git format-patch origin/master
    This will output a list of one or more patches that can be downloaded and applied by developers using the command git am.
  3. Now, write a high level summary of your changes:
    cat <<EOF> msg
    Subject: My favorite patches
    Hello,
    Included are several packages which implement feature X and have been thoroughly tested.
    Thanks!
    EOF
  4. Finally, send the patches along with the descriptive summary to autoqa-devel@lists.fedorahosted.org for review:
    yum install git-email
    git send-email --no-chain-reply-to --quiet --to autoqa-devel@lists.fedorahosted.org msg *.patch

Named Branch

If you are developing a feature or working on a rather large patchset for AutoQA, you are recommended to create a named branch to work from. This makes patch submission and merging easier for the AutoQA maintainers.

To create and share a named branch ...

  1. Create a new branch locally, based on current branch (master)
    git checkout -b myusername
  2. Now, share your branch by pushing it into the remote repo
    git push --all
  3. Finally, configure the local repo to merge with the remote so git pull works
    git config branch.myusername.remote origin
    git config branch.myusername.merge refs/heads/myusername

References