How does one offer patches?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How does one offer patches?

Bruce Sherwood-3
Please forgive me for my ignorance, but how does one offer patches to
IDLE? At http://vpython.org/vidle/patch.diff is a patch from the
idlelib installed with Windows Python3.1.2 to vidle, where vidle
incorporates the work done in the 2009 GSoC by Guilherme Polo, updated
for Python 3. For details, see my posts of Sept. 14.

I have several questions:

1) Is the idlelib shipped with Windows Python 3.1.2 the right base to
diff against?

2) If not, against what base should I make the diff?

3) Is one diff for all of idlelib okay, or does one submit separate
diff files for each file?

4) How/where do I formally offer this diff? I've never done this before.

I should add that just today I remade the diff at
http://vpython.org/vidle/patch.diff because I discovered that I'd
missed an important correction Guilherme had made. The error is
present in the Python 3.1.2 idlelib. In IOBinding.py one should delete
this statement:

     self.text.see("insert")

Unless this statement is deleted, when you open a long file the first
line is not seen; it's above the edit display. This can be pretty
confusing.

Bruce Sherwood
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: How does one offer patches?

Bruce Sherwood-3
Hmm. The "missing top line" problem is seen on Windows. I find that
whether the statement is present or not in IOBinding.py makes no
difference on the Mac.

Bruce Sherwood

On Sun, Oct 10, 2010 at 3:40 PM, Bruce Sherwood <[hidden email]> wrote:

>
> I should add that just today I remade the diff at
> http://vpython.org/vidle/patch.diff because I discovered that I'd
> missed an important correction Guilherme had made. The error is
> present in the Python 3.1.2 idlelib. In IOBinding.py one should delete
> this statement:
>
>     self.text.see("insert")
>
> Unless this statement is deleted, when you open a long file the first
> line is not seen; it's above the edit display. This can be pretty
> confusing.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: How does one offer patches?

Bruce Sherwood-3
Nor does it matter on (Ubuntu) Linux. It only seems to matter on Windows.

Bruce Sherwood

On Sun, Oct 10, 2010 at 5:04 PM, Bruce Sherwood <[hidden email]> wrote:
> Hmm. The "missing top line" problem is seen on Windows. I find that
> whether the statement is present or not in IOBinding.py makes no
> difference on the Mac.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: How does one offer patches?

Tal Einat
In reply to this post by Bruce Sherwood-3
Bruce Sherwood wrote:

> Please forgive me for my ignorance, but how does one offer patches to
> IDLE? At http://vpython.org/vidle/patch.diff is a patch from the
> idlelib installed with Windows Python3.1.2 to vidle, where vidle
> incorporates the work done in the 2009 GSoC by Guilherme Polo, updated
> for Python 3. For details, see my posts of Sept. 14.
>
> I have several questions:
>
> 1) Is the idlelib shipped with Windows Python 3.1.2 the right base to
> diff against?
>
> 2) If not, against what base should I make the diff?
>
> 3) Is one diff for all of idlelib okay, or does one submit separate
> diff files for each file?
>
> 4) How/where do I formally offer this diff? I've never done this before.
>
> I should add that just today I remade the diff at
> http://vpython.org/vidle/patch.diff because I discovered that I'd
> missed an important correction Guilherme had made. The error is
> present in the Python 3.1.2 idlelib. In IOBinding.py one should delete
> this statement:
>
>     self.text.see("insert")
>
> Unless this statement is deleted, when you open a long file the first
> line is not seen; it's above the edit display. This can be pretty
> confusing.

Since IDLE is part of the Python stdlib, patches (and bugs and
features requests) should be posted on the Python bug tracker at
bugs.python.org. For major patches such as this, a mention on the
idle-dev mailing list is also helpful to get things moving along.

A patch should contain all relevant changes to all relevant files.
Ideally, a patch should encapsulate a single set of changes, and after
applying it everything should still work as expected. If several
unrelated changes have been made in VIDLE, it might be better to post
a patch for each change separately to make testing and reviewing
simpler. This can take a bit of work though, and it's better to post
one big patch than to post nothing at all.

Patches should preferably be based on a recent SVN revision. The more
recent the better, but next point is more important...

Patches should only be posted after having been well tested in order
to avoid frustrating the reviewers. From my experience, posting a
patch and later mentioning small fixes and edge-cases will often cause
a patch not to be accepted, because nobody will want to review it.
Posting a patch and requesting help in fixing a few last problems is
okay, of course, as long as you've recognized the problems and mention
them in advance.

I hope this helps! I'm itching to get Guilhereme's changes in!

- Tal Einat
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: How does one offer patches?

Bruce Sherwood-3
Thanks much, Tal. There has already been extensive testing of VIDLE.
Guilherme's GSoC version was distributed under the name of VIDLE with
VPython 2.6 or 2.7 during the past year with no hint of problems. As
part of getting VPython to work with Python 3 I manually applied
Guilherme's patches to the Python 3 idlelib to make a Python 3 VIDLE
and the diff patch. I've been using Python 3 with VPython and VIDLE
for several weeks on Windows with no problems, and I've used VIDLE a
little on a Mac. However, I don't do anything fancy with VIDLE, so I
have no way of knowing whether there could be problems with some
features I don't use.

Again, I'm ignorant: How/where do I get "a recent SVN revision"? Would
it be any different from C:\Python3.1\Lib\idlelib? (I have Python3.1.2
installed.)

I don't feel competent to provide individual patches that are
feature-specific, because I haven't studied IDLE in any great depth
but rather concentrated just on getting Guilherme's work into the
latest Python 3 idlelib. But if I'm told how to get something more
recent than C:\Python3.1\Lib\idlelib I can produce a diff patch
against it, as one large diff.

A detail: Guilherme produced a "Revert" plugin, and the corresponding
file doesn't show up in the diff. How would I offer the new file?

Bruce Sherwood

On Sun, Oct 10, 2010 at 6:19 PM, Tal Einat <[hidden email]> wrote:

> Bruce Sherwood wrote:
>> Please forgive me for my ignorance, but how does one offer patches to
>> IDLE? At http://vpython.org/vidle/patch.diff is a patch from the
>> idlelib installed with Windows Python3.1.2 to vidle, where vidle
>> incorporates the work done in the 2009 GSoC by Guilherme Polo, updated
>> for Python 3. For details, see my posts of Sept. 14.
>>
>> I have several questions:
>>
>> 1) Is the idlelib shipped with Windows Python 3.1.2 the right base to
>> diff against?
>>
>> 2) If not, against what base should I make the diff?
>>
>> 3) Is one diff for all of idlelib okay, or does one submit separate
>> diff files for each file?
>>
>> 4) How/where do I formally offer this diff? I've never done this before.
>>
>> I should add that just today I remade the diff at
>> http://vpython.org/vidle/patch.diff because I discovered that I'd
>> missed an important correction Guilherme had made. The error is
>> present in the Python 3.1.2 idlelib. In IOBinding.py one should delete
>> this statement:
>>
>>     self.text.see("insert")
>>
>> Unless this statement is deleted, when you open a long file the first
>> line is not seen; it's above the edit display. This can be pretty
>> confusing.
>
> Since IDLE is part of the Python stdlib, patches (and bugs and
> features requests) should be posted on the Python bug tracker at
> bugs.python.org. For major patches such as this, a mention on the
> idle-dev mailing list is also helpful to get things moving along.
>
> A patch should contain all relevant changes to all relevant files.
> Ideally, a patch should encapsulate a single set of changes, and after
> applying it everything should still work as expected. If several
> unrelated changes have been made in VIDLE, it might be better to post
> a patch for each change separately to make testing and reviewing
> simpler. This can take a bit of work though, and it's better to post
> one big patch than to post nothing at all.
>
> Patches should preferably be based on a recent SVN revision. The more
> recent the better, but next point is more important...
>
> Patches should only be posted after having been well tested in order
> to avoid frustrating the reviewers. From my experience, posting a
> patch and later mentioning small fixes and edge-cases will often cause
> a patch not to be accepted, because nobody will want to review it.
> Posting a patch and requesting help in fixing a few last problems is
> okay, of course, as long as you've recognized the problems and mention
> them in advance.
>
> I hope this helps! I'm itching to get Guilhereme's changes in!
>
> - Tal Einat
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: How does one offer patches?

Tal Einat
Bruce Sherwood wrote:

> Thanks much, Tal. There has already been extensive testing of VIDLE.
> Guilherme's GSoC version was distributed under the name of VIDLE with
> VPython 2.6 or 2.7 during the past year with no hint of problems. As
> part of getting VPython to work with Python 3 I manually applied
> Guilherme's patches to the Python 3 idlelib to make a Python 3 VIDLE
> and the diff patch. I've been using Python 3 with VPython and VIDLE
> for several weeks on Windows with no problems, and I've used VIDLE a
> little on a Mac. However, I don't do anything fancy with VIDLE, so I
> have no way of knowing whether there could be problems with some
> features I don't use.
>
> Again, I'm ignorant: How/where do I get "a recent SVN revision"? Would
> it be any different from C:\Python3.1\Lib\idlelib? (I have Python3.1.2
> installed.)

Generally this is the best way to generate a patch for submission:

1) install an SVN client (on Windows I recommend TortoiseSVN)
2) checkout the Lib\idlelib directory from the Python subversion repository:
http://svn.python.org/projects/python/branches/py3k/Lib/idlelib
(I wrote that by hand, hopefully it is correct, otherwise use
TortoiseSVN's repository browser to get the right path.)
3) apply your changes (remember to "svn add" new files, and "svn
delete" removed files!)
4) create a patch (TortoiseSVN has a "create patch" option)

For your change, it might be better to:
1) don't check out the latest revision; instead, check out the
revision for 3.1.2 (check which revision the 3.1.2 tag was created, by
browsing the repository)
2) copy your changes
3) "svn update" to the latest revision, so you can locally merge in
the latest updates to IDLE
4) now create a patch and send it

> I don't feel competent to provide individual patches that are
> feature-specific, because I haven't studied IDLE in any great depth
> but rather concentrated just on getting Guilherme's work into the
> latest Python 3 idlelib. But if I'm told how to get something more
> recent than C:\Python3.1\Lib\idlelib I can produce a diff patch
> against it, as one large diff.

That would be fine, then. Try to describe all of the changes in the
description you write when submitting the patch, though.

> A detail: Guilherme produced a "Revert" plugin, and the corresponding
> file doesn't show up in the diff. How would I offer the new file?

If you use SVN to generate the patch, "svn add" the file(s) before
creating the patch.

> Bruce Sherwood

Good luck!

- Tal Einat
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: How does one offer patches?

Bruce Sherwood-3
Again, many thanks for the clear instructions, Tal. I'll work on this.

Bruce Sherwood

On Mon, Oct 11, 2010 at 4:01 AM, Tal Einat <[hidden email]> wrote:

> Bruce Sherwood wrote:
>> Thanks much, Tal. There has already been extensive testing of VIDLE.
>> Guilherme's GSoC version was distributed under the name of VIDLE with
>> VPython 2.6 or 2.7 during the past year with no hint of problems. As
>> part of getting VPython to work with Python 3 I manually applied
>> Guilherme's patches to the Python 3 idlelib to make a Python 3 VIDLE
>> and the diff patch. I've been using Python 3 with VPython and VIDLE
>> for several weeks on Windows with no problems, and I've used VIDLE a
>> little on a Mac. However, I don't do anything fancy with VIDLE, so I
>> have no way of knowing whether there could be problems with some
>> features I don't use.
>>
>> Again, I'm ignorant: How/where do I get "a recent SVN revision"? Would
>> it be any different from C:\Python3.1\Lib\idlelib? (I have Python3.1.2
>> installed.)
>
> Generally this is the best way to generate a patch for submission:
>
> 1) install an SVN client (on Windows I recommend TortoiseSVN)
> 2) checkout the Lib\idlelib directory from the Python subversion repository:
> http://svn.python.org/projects/python/branches/py3k/Lib/idlelib
> (I wrote that by hand, hopefully it is correct, otherwise use
> TortoiseSVN's repository browser to get the right path.)
> 3) apply your changes (remember to "svn add" new files, and "svn
> delete" removed files!)
> 4) create a patch (TortoiseSVN has a "create patch" option)
>
> For your change, it might be better to:
> 1) don't check out the latest revision; instead, check out the
> revision for 3.1.2 (check which revision the 3.1.2 tag was created, by
> browsing the repository)
> 2) copy your changes
> 3) "svn update" to the latest revision, so you can locally merge in
> the latest updates to IDLE
> 4) now create a patch and send it
>
>> I don't feel competent to provide individual patches that are
>> feature-specific, because I haven't studied IDLE in any great depth
>> but rather concentrated just on getting Guilherme's work into the
>> latest Python 3 idlelib. But if I'm told how to get something more
>> recent than C:\Python3.1\Lib\idlelib I can produce a diff patch
>> against it, as one large diff.
>
> That would be fine, then. Try to describe all of the changes in the
> description you write when submitting the patch, though.
>
>> A detail: Guilherme produced a "Revert" plugin, and the corresponding
>> file doesn't show up in the diff. How would I offer the new file?
>
> If you use SVN to generate the patch, "svn add" the file(s) before
> creating the patch.
>
>> Bruce Sherwood
>
> Good luck!
>
> - Tal Einat
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev