Does it bother anyone else that Squeak prints diffs
+this line was added -this line was removed while Unix-derived tools (including those influenced by Unix, like Github) print -this line was removed +this line was added ? For a project of mine I added the following to rearrange things more conventionally: diff: diff doIfMatch: matchBlock ifInsert: insertBlock ifRemove: removeBlock "Like TextDiffBuilder >> patchSequenceDoIfMatch:ifInsert:ifRemove:, but with insertions/removals in the other order (matching what lots of Unix-heritage diff-generation tools do)." | pending flush | pending := OrderedCollection new. flush := [ pending do: insertBlock. pending removeAll]. diff patchSequenceDoIfMatch: [:line | flush value. matchBlock value: line] ifInsert: [:line | pending add: line] ifRemove: removeBlock. flush value. ... where `diff` is an instance of TextDiffBuilder. Tony |
> On 9. Nov 2020, at 15:46, Tony Garnock-Jones <[hidden email]> wrote: > > Does it bother anyone else that Squeak prints diffs > > +this line was added > -this line was removed > > while Unix-derived tools (including those influenced by Unix, like > Github) print > > -this line was removed > +this line was added > > ? D'oh! That explains my constant confusion! -t |
Well, personally I have always been used the "+ before -" way, so if you change it, I'll need to adapt. :P Von: Squeak-dev <[hidden email]> im Auftrag von Tobias Pape <[hidden email]>
Gesendet: Montag, 9. November 2020 15:59:52 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Diffs "upside-down" > On 9. Nov 2020, at 15:46, Tony Garnock-Jones <[hidden email]> wrote: > > Does it bother anyone else that Squeak prints diffs > > +this line was added > -this line was removed > > while Unix-derived tools (including those influenced by Unix, like > Github) print > > -this line was removed > +this line was added > > ? D'oh! That explains my constant confusion! -t
Carpe Squeak!
|
In reply to this post by Tony Garnock-Jones-5
> On 2020-11-09, at 6:46 AM, Tony Garnock-Jones <[hidden email]> wrote: > > Does it bother anyone else that Squeak prints diffs > > +this line was added > -this line was removed > > while Unix-derived tools (including those influenced by Unix, like > Github) print > > -this line was removed > +this line was added Yup; it horrifies me that the unix tools get it wrong :-| tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: MC: Melt down Core |
In reply to this post by Tony Garnock-Jones-5
On Mon, Nov 9, 2020 at 6:58 AM Tony Garnock-Jones <[hidden email]> wrote: Does it bother anyone else that Squeak prints diffs Yes, bothers me greatly. Please someone fix this :) - Vanessa - |
Hi all! It is configurable now via System-mt.1192 in Trunk. The default is (now) remove-before-insert. Best, Marcel
|
Love it! Thank you! I'll tweak it now to allow a per-instance
configurability of it, because I need to use it Unix-style programmatically without overriding the user's image preference. On 11/10/20 8:58 AM, Marcel Taeumel wrote: > Hi all! > > It is configurable now via System-mt.1192 in Trunk. The default is (now) > remove-before-insert. > > Best, > Marcel > > >> Am 10.11.2020 05:59:41 schrieb Vanessa Freudenberg <[hidden email]>: >> >> On Mon, Nov 9, 2020 at 6:58 AM Tony Garnock-Jones >> <[hidden email] <mailto:[hidden email]>> wrote: >> >> Does it bother anyone else that Squeak prints diffs >> >> +this line was added >> -this line was removed >> >> >> Yes, bothers me greatly. Please someone fix this :) >> >> - Vanessa - > > |
Sure. Maybe take a look at: Morph class >> #preferredCornerRadius Morph >> #cornerRadius There are other examples in the image. Best, Marcel
|
Aha - hm. I went with an instance variable. Do you think I should change
it to use a property instead? On 11/10/20 9:42 AM, Marcel Taeumel wrote: > Sure. Maybe take a look at: > > Morph class >> #preferredCornerRadius > Morph >> #cornerRadius > > There are other examples in the image. > > Best, > Marcel >> >> Am 10.11.2020 09:40:24 schrieb Tony Garnock-Jones >> <[hidden email]>: >> >> Love it! Thank you! I'll tweak it now to allow a per-instance >> configurability of it, because I need to use it Unix-style >> programmatically without overriding the user's image preference. >> >> On 11/10/20 8:58 AM, Marcel Taeumel wrote: >> > Hi all! >> > >> > It is configurable now via System-mt.1192 in Trunk. The default is >> (now) >> > remove-before-insert. >> > >> > Best, >> > Marcel >> > >> > >> >> Am 10.11.2020 05:59:41 schrieb Vanessa Freudenberg : >> >> >> >> On Mon, Nov 9, 2020 at 6:58 AM Tony Garnock-Jones >> >> > wrote: >> >> >> >> Does it bother anyone else that Squeak prints diffs >> >> >> >> +this line was added >> >> -this line was removed >> >> >> >> >> >> Yes, bothers me greatly. Please someone fix this :) >> >> >> >> - Vanessa - >> > >> > |
inst var is fine. I just pointed you to a roughly equivalent example. I would avoid reading the preference in #initialize but keep the inst var "nil" until overwritten.
|
Free forum by Nabble | Edit this page |