1

Topic: Update Git page on the website

Git Source Code Management

Could we update the above Git page with details on how a budding new developer could create their first git patch?  First stab at some wording ...


How to create your first GParted patch using git

1. Clone the git repository locally:

git clone git://git.gnome.org/gparted

2. Set your name and email address.

git config --global user.name "Joe Bloggs"
git config --global user.email "joe.bloggs@example.com"

3. Create a new branch and switch to it:

cd gparted
git checkout -b feature

4. Edit the code, compile and test it.

# Use favourite editor
./autogen.sh
make
su root -c src/gpartedbin

5. Commit change to git

git add file1 file2 ...
git commit

Compose a suitable commit message:

        Short one line summary of change (#999999)

        Optional longer description explaining why the change is necessary.
        Include details that will help the reviewer understand how the code
        code is broken and being fixed or why this change is an improvement.

        Bug #999999 - GNOME Bugzilla one line summary

6. Often make large and complicated changes as a series of smaller changes by repeating steps 4. and 5. as necessary.

7. Create a patch file:

 git format-patch master --stdout > ~/mypatch.mbox

8. Final review, apply, compile and test:

cd /tmp
git clone git://git.gnome.org/gparted gparted-test
cd gparted-test
git am ~/mypatch.mbox
./autogen.sh
make
su root -c src/gpartedbin

9. Attach ~/mypatch.mbox to your GNOME bug report with a few words


--
Thanks,
Mike

2

Re: Update Git page on the website

Hi Mike,

This is an excellent description of how to create a patch for GParted.  One extra thing we can add is that each patch should properly compile and run on it's own.

I will plan to add these steps to a page on the GParted web site.

3

Re: Update Git page on the website

Thank you Mike for creating this set of instructions on how to create your first GParted patch using git.

These instructions have been added to the GParted git page.  I have taken the liberty of changing step 6 into a tip, and adding the "-n" option to the format-patch command so that the patches are numbered.

If you have any suggestions for further enhancement then please let me know.

4

Re: Update Git page on the website

Hi Curtis,

Can we also have a references section at the bottom of the same page as follows.  First four were taken from the GNOME git page (or is the GNOME git page).  The last two reflect my thinking that looking under the hood and knowing what is happening provides real understanding and confidence with git.  I ummed and ahhed about including the video, but I thinks its really good.

Thanks,
Mike
--

Suggested references:

5

Re: Update Git page on the website

Your list of suggested git references is a great idea.  Consider the git page updated.  smile