Difference between revisions of "Buildroot how to contribute"

From eLinux.org
Jump to: navigation, search
(Created page with "A short guide, basically copy/paste from [http://lists.busybox.net/pipermail/buildroot/2010-December/039181.html mailing list]. == Configure Git == Configure your name and e-m...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
A short guide, basically copy/paste from [http://lists.busybox.net/pipermail/buildroot/2010-December/039181.html mailing list].
+
== General ==
 +
Patches should be sent to mailing list.
  
 
== Configure Git ==  
 
== Configure Git ==  
Line 8: Line 9:
 
  git config --global user.email firstname.lastname at somewhere.com
 
  git config --global user.email firstname.lastname at somewhere.com
  
And tell git how to send emails :
+
Tell git how to send emails
  
 
  git config --global sendemail.smtpserver mysmtpserver
 
  git config --global sendemail.smtpserver mysmtpserver
  
And to avoid chained reply :
+
To avoid chained reply
  
 
  git config --global sendemail.chainreplyto false
 
  git config --global sendemail.chainreplyto false
 +
 +
=== Where do I get ''git send-email'' ===
 +
On Debian/Ubuntu you can install it by
 +
sudo apt-get install git-email
  
 
== Basic workflow ==
 
== Basic workflow ==
  
# Clone (to be done only once)
+
Clone (to be done only once)
#*git clone git://git.busybox.net/buildroot
+
git clone git://git.busybox.net/buildroot
# Configure Git, if not done already
+
Configure Git, if not done already
# Create a branch to work on your topic (to be done for every separate topic you'd like to work with)
+
 
#* git checkout -b mytopic
+
Create a branch to work on your topic (to be done for every separate topic you'd like to work with)
#** Note that this also switches immediatly to the new '''mytopic''' branch. You can run 'git branch' at any time to know on which branch you are.
+
git checkout -b mytopic
# Make some modifications, for one particuler subtopic (like adding the vala compiler)
+
* Note that this also switches immediatly to the new '''mytopic''' branch. You can run 'git branch' at any time to know on which branch you are.
# Commit those modifications
+
Make some modifications, for one particuler subtopic (like adding the vala compiler)
# git commit -s -a
+
 
#* And enter an appropriate commit log.
+
If you created new files, add them
#**  If you created new files, add them with "git add".
+
git add file_you_just_created
# Review your changes
+
Commit those modifications and enter an appropriate commit log.
#* git log -p master..
+
git commit -s -a
# Prepare patches for your changes
+
Review your changes
#* git format-patch master
+
git log -p master..
#**  This will generate a set of 000X-*.patch files in the Buildroot directory
+
Prepare patches for your changes, this will generate a set of 000X-*.patch files in the Buildroot directory
# Send your patches to the list
+
git format-patch master
#* git send-email --to buildroot at uclibc.org --compose *.patch
+
Send your patches to the list
# All done
+
git send-email --to buildroot at uclibc.org --compose *.patch
 +
All done
 +
 
 +
=== In case of mistakes in my branch ===
 +
If while reviewing your commits you find that you need to merge some of
 +
them (because you did some mistakes that you fixed later and you don't
 +
want the world to know about your mistakes), then you have to use the
 +
rebasing feature of git
 +
git rebase -i master
 +
Git will open up a text editor with the list of your commits. You can
 +
edit this file to change the order of the commits, or to change the
 +
action taken on a particular commit (see the file itself for
 +
documentation on those actions).
 +
pick SOMEGITHASH package: add foobar
 +
pick SOMEGITHASH package: add barfoo
 +
pick SOMEGITHASH I did something wrong in add foobar, merge me
 +
So obviously you want the last commit to be merged into the first one,
 +
so that nobody knows you did some mistakes during your development. So,
 +
turn those three lines into the following ones
 +
pick SOMEGITHASH package: add foobar
 +
fixup SOMEGITHASH I did something wrong in add foobar, merge me
 +
pick SOMEGITHASH package: add barfoo
 +
And exit the text editor. Git will reorganize your commits, and you'll
 +
end up with just two commits.

Latest revision as of 16:53, 6 March 2012

General

Patches should be sent to mailing list.

Configure Git

Configure your name and e-mail. This needs to be only once, if configured with --global. If you want to use some other settings for buildroot project, you first need to clone buildroot repository and then use these same commands without --global keyword.

git config --global user.name "Firstname Lastname"
git config --global user.email firstname.lastname at somewhere.com

Tell git how to send emails

git config --global sendemail.smtpserver mysmtpserver

To avoid chained reply

git config --global sendemail.chainreplyto false

Where do I get git send-email

On Debian/Ubuntu you can install it by

sudo apt-get install git-email

Basic workflow

Clone (to be done only once)

git clone git://git.busybox.net/buildroot

Configure Git, if not done already

Create a branch to work on your topic (to be done for every separate topic you'd like to work with)

git checkout -b mytopic
  • Note that this also switches immediatly to the new mytopic branch. You can run 'git branch' at any time to know on which branch you are.

Make some modifications, for one particuler subtopic (like adding the vala compiler)

If you created new files, add them

git add file_you_just_created

Commit those modifications and enter an appropriate commit log.

git commit -s -a

Review your changes

git log -p master..

Prepare patches for your changes, this will generate a set of 000X-*.patch files in the Buildroot directory

git format-patch master

Send your patches to the list

git send-email --to buildroot at uclibc.org --compose *.patch

All done

In case of mistakes in my branch

If while reviewing your commits you find that you need to merge some of them (because you did some mistakes that you fixed later and you don't want the world to know about your mistakes), then you have to use the rebasing feature of git

git rebase -i master

Git will open up a text editor with the list of your commits. You can edit this file to change the order of the commits, or to change the action taken on a particular commit (see the file itself for documentation on those actions).

pick SOMEGITHASH package: add foobar
pick SOMEGITHASH package: add barfoo
pick SOMEGITHASH I did something wrong in add foobar, merge me

So obviously you want the last commit to be merged into the first one, so that nobody knows you did some mistakes during your development. So, turn those three lines into the following ones

pick SOMEGITHASH package: add foobar
fixup SOMEGITHASH I did something wrong in add foobar, merge me
pick SOMEGITHASH package: add barfoo

And exit the text editor. Git will reorganize your commits, and you'll end up with just two commits.