Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How to create patches?
How to create patches? [message #491825] Fri, 16 October 2009 02:22 Go to next message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
I made a one line change and am create and submit a patch into Bugzilla
but I don't even know how to start. According to the documentation, I'm
supposed to just invoke 'git diff' (or at least, I think that's what I'm
supposed to do). This is good, I get a diff, but the documentation also
mentions something about providing a commit message. How does that come
into play? My only experience with distributed SCM systems is cloning a
bzr repository (and now a git one) so I really don't know what I'm
supposed to do.

Chris's patch doesn't seem to have any commit messages as far as I can
see, it seems like a regular old CVS diff to me.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=291108

Any pointers would be much appreciated.

Thanks,
Remy
Re: How to create patches? [message #491880 is a reply to message #491825] Fri, 16 October 2009 11:24 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1212
Registered: July 2009
Senior Member
Find detailed instructions for contribution here.

You may either directly push your change from git to Gerrit for review as described in the contributor guide.

Alternatively you may run "git format-patch" on the git branch you developed your patch on and attach the resulting file
as a patch into Bugzilla. See an example here. This way your git commit message will be transferred from git into the
patch file. Bugzilla also knows how to extract the diff from such attachments, see an example here.

--
Matthias
Re: How to create patches? [message #491999 is a reply to message #491880] Fri, 16 October 2009 23:11 Go to previous messageGo to next message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
On Fri, 16 Oct 2009 07:25:00 -0400, Matthias Sohn wrote:
> Find detailed instructions for contribution
> http://wiki.eclipse.org/EGit/Contributor_Guide.

Yeah, I tried reading that before posting but it didn't make a lot of
sense to me. Could be just me or it could be because I've never used a
decentralized SCM system, oh well.

What I ended up doing was committing through the EGit interface and then
using 'git format-patch --root'. I have attached my simple patch to
Bugzilla in the mean time. It looks right based on the other attachments
I've seen attached to Bugzilla but I could be wrong. :|
https://bugs.eclipse.org/bugs/show_bug.cgi?id=292588

Regards,
Remy
Re: How to create patches? [message #492006 is a reply to message #491999] Sat, 17 October 2009 00:18 Go to previous message
Shawn O. Pearce is currently offline Shawn O. PearceFriend
Messages: 82
Registered: July 2009
Member
Remy Suen wrote:
> What I ended up doing was committing through the EGit interface and then
> using 'git format-patch --root'.

--root wasn't necessary for 1 commit. I think you wanted 'git
format-patch -1' to make it format the most recent commit on the current
branch.

> I have attached my simple patch to
> Bugzilla in the mean time. It looks right based on the other attachments
> I've seen attached to Bugzilla but I could be wrong. :|
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=292588

Thanks, applied. I adjusted the commit message a bit to better fit with
standard git conventions, but otherwise the patch was correct.
Re: How to create patches? [message #575000 is a reply to message #491825] Fri, 16 October 2009 11:25 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1212
Registered: July 2009
Senior Member
Find detailed instructions for contribution http://wiki.eclipse.org/EGit/Contributor_Guide

You may either directly push your change from git to http://egit.eclipse.org/r/ for review as described in the contributor guide.

Alternatively you may run "git format-patch" on the git branch you developed your patch on and attach the resulting file
as a patch into Bugzilla. See an example https://bugs.eclipse.org/bugs/show_bug.cgi?id=290562 This way your git commit message will be transferred from git into the
patch file. Bugzilla also knows how to extract the diff from such attachments, see an example https://bugs.eclipse.org/bugs/attachment.cgi?id=148430&a ction=diff

--
Matthias
Re: How to create patches? [message #575044 is a reply to message #575000] Fri, 16 October 2009 23:11 Go to previous message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
On Fri, 16 Oct 2009 07:25:00 -0400, Matthias Sohn wrote:
> Find detailed instructions for contribution
> http://wiki.eclipse.org/EGit/Contributor_Guide

Yeah, I tried reading that before posting but it didn't make a lot of
sense to me. Could be just me or it could be because I've never used a
decentralized SCM system, oh well.

What I ended up doing was committing through the EGit interface and then
using 'git format-patch --root'. I have attached my simple patch to
Bugzilla in the mean time. It looks right based on the other attachments
I've seen attached to Bugzilla but I could be wrong. :|
https://bugs.eclipse.org/bugs/show_bug.cgi?id=292588

Regards,
Remy
Re: How to create patches? [message #575077 is a reply to message #491999] Sat, 17 October 2009 00:18 Go to previous message
Shawn O. Pearce is currently offline Shawn O. PearceFriend
Messages: 82
Registered: July 2009
Member
Remy Suen wrote:
> What I ended up doing was committing through the EGit interface and then
> using 'git format-patch --root'.

--root wasn't necessary for 1 commit. I think you wanted 'git
format-patch -1' to make it format the most recent commit on the current
branch.

> I have attached my simple patch to
> Bugzilla in the mean time. It looks right based on the other attachments
> I've seen attached to Bugzilla but I could be wrong. :|
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=292588

Thanks, applied. I adjusted the commit message a bit to better fit with
standard git conventions, but otherwise the patch was correct.
Previous Topic:How to create patches?
Next Topic:Cloning Public Repository in Github
Goto Forum:
  


Current Time: Tue Aug 16 01:23:43 GMT 2022

Powered by FUDForum. Page generated in 0.02130 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top