Heh. I changed a gnx in the big PR by mistake

46 views
Skip to first unread message

Edward K. Ream

unread,
Jul 6, 2023, 12:04:18 PM7/6/23
to leo-editor
I'm glad we've had the conversation about cut-node/paste-node. It reminded me of something that has been bothering me subconsciously.

The diffs for PR #3215 show that the gnx changed for p.get_GNX, renamed.

- #@+node:tbrown.20111010104549.26758: *4* p.get_UNL
+ #@+node:ekr.20230628174317.1: *5* p.get_full_gnx_UNL

How did I discover this, you ask? How did I know to look for this diff?

The answer is simple: Weeks ago, Leo's git-diff-pr command showed that I had deleted p.get_UNL and then added p.get_UNL. This kind of diff is the classic symptom of cut-node/paste-node.

The reason I did the cut/paste of this node is interesting, but not interesting enough to tell here :-)

The tweak PR, #3424, will fix this misattribution. Terry deserves all the credit(??) for this method.

Summary

Leo's devs (and only devs) should beware when Leo's git-diff or git-diff-pr commands show nodes that have been deleted and added. This kind of diff is the classic symptom of cutting/pasting nodes.

The tweaks PR will restore the correct attribution for Terry's original g.get_UNL method.

Edward

Thomas Passin

unread,
Jul 6, 2023, 12:11:51 PM7/6/23
to leo-editor
See, it even happens to Edward.  Let's make things so that it won't happen to anyone.  Reminding people (including devs) to "be careful" isn't enough.

Edward K. Ream

unread,
Jul 6, 2023, 12:31:55 PM7/6/23
to leo-editor
On Thursday, July 6, 2023 at 11:11:51 AM UTC-5 Thomas wrote:

Reminding people (including devs) to "be careful" isn't enough.

It's not about being careful. It's about not needlessly cutting/pasting nodes.

Devs must not cut/paste nodes if they intend to issue a PR that changes those nodes.

Devs should never falsely claim to be the creator of a node. Got it?

Edward

Edward K. Ream

unread,
Jul 6, 2023, 12:35:42 PM7/6/23
to leo-editor
On Thursday, July 6, 2023 at 11:04:18 AM UTC-5 Edward K. Ream wrote:

The diffs for PR #3215 show that the gnx changed for p.get_GNX, renamed.

- #@+node:tbrown.20111010104549.26758: *4* p.get_UNL
+ #@+node:ekr.20230628174317.1: *5* p.get_full_gnx_UNL

Correcting this mistake is fraught because both the name and the contents of the original node changed.

In other words, so much has changed that I might actually be the author of all affected nodes. See the details in the last to-do item of the tweaks PR.

Summary

I'll restore Terry's gnx only if it makes sense to do so.

Edward

Thomas Passin

unread,
Jul 6, 2023, 12:58:32 PM7/6/23
to leo-editor
No I don't. Say you (Edward, I imagine) move a subtree that contains Terry's nodes to the Attic.  If you forget and just do a cut-and-paste, suddenly they become your nodes.  Or maybe just the head of the subtree becomes your node,  I don't even know.  

Furthermore, I have been developing plugins and enhancing Leo internals for some time and I have *never* once thought that by creating a node I was claiming to be its creator.  Or that by moving a node by cut-and-paste I was changing its creator.  Why would I, and how would I have known about that subtlety?  After all, node ids are ordinarily invisible to the creator and user.

Let's just make the normal behavior agree with normal expectations.

Edward K. Ream

unread,
Jul 6, 2023, 1:44:36 PM7/6/23
to leo-e...@googlegroups.com
On Thu, Jul 6, 2023 at 11:58 AM Thomas Passin wrote:

Say you (Edward, I imagine) move a subtree that contains Terry's nodes to the Attic.  If you forget and just do a cut-and-paste, suddenly they become your nodes.  Or maybe just the head of the subtree becomes your node,  I don't even know.  

Furthermore, I have been developing plugins and enhancing Leo internals for some time and I have *never* once thought that by creating a node I was claiming to be its creator.  Or that by moving a node by cut-and-paste I was changing its creator.  Why would I, and how would I have known about that subtlety?  After all, node ids are ordinarily invisible to the creator and user.

This has been a useful discussion. I never realized the side effects of cut-node followed by copy-node.

Let's just make the normal behavior agree with normal expectations.

I think #3429 will do that in many cases.

Edward

Thomas Passin

unread,
Jul 6, 2023, 8:02:39 PM7/6/23
to leo-editor
: )

Edward K. Ream

unread,
Jul 6, 2023, 8:39:06 PM7/6/23
to leo-e...@googlegroups.com
On Thu, Jul 6, 2023 at 7:02 PM Thomas Passin <tbp1...@gmail.com> wrote:
: )

Congratulations on another excellent collaboration.

We have, yet again, accomplished what neither would have done alone.


Edward

Edward K. Ream

unread,
Jul 6, 2023, 8:43:20 PM7/6/23
to leo-editor


On Thursday, July 6, 2023 at 7:39:06 PM UTC-5 Edward K. Ream wrote:


Sent too early by mistake. I meant to say that PR 3430 needs more testing.

Edward
Reply all
Reply to author
Forward
0 new messages