Author Topic: please advise linux differnce program to compare old vs up graded files  (Read 5804 times)

0 Members and 5 Guests are viewing this topic.

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3910
  • Country: it
Re: please advise linux differnce program to compare old vs up graded files
« Reply #25 on: February 28, 2025, 09:27:03 am »
On windows i use WinMerge
...
I wonder if there is something simillar in linux

Have you looked at Beyond Compare? Fairly similar ui and feature set, and cross platform implementation for win, mac, and linux. It's not free, but well worth the modest cost, imho.

several times. Didn't like it. HAve you tried winmerge?
 
The following users thanked this post: Wilson__

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5090
  • Country: gb
Re: please advise linux differnce program to compare old vs up graded files
« Reply #26 on: February 28, 2025, 02:25:42 pm »
Yes, I remember that. This is an interesting approach, although not a replacement for a classic diff IMO, but complementary. Indeed, it would consider two pieces of code identical if they have the same AST (if I get it right), but you may have refactored code in a way that produces the exact same AST (but refactored maybe for readability reasons or otherwise) and the tool would miss that?

Yup, AST.

Although the goal of "refactoring" is always to improve the internal code by making many small changes without changing the external behavior of the code, "behavior-preserving changes" have several shades of gray.

Some techniques preserve the behavior but alter AST
Some techniques preserve both

renaming a function or variable across an entire code base doesn't produce any visible effect on the AST, because entity[]={ functions, types, variables } are internally managed by an ID[]={ FID, TIP, VID }.

So I had to introduce an additional level of processing that also analyzes the entity table, where the entities also keep the "name" part associated with their ID. This way myDiff can tell if an entity has been renamed.

The following preserve the behavor at the interface level, but alter the module AST:
  • green-inline, when you focus on simplifying code by eliminating unnecessary elements
  • extract-and-distill, when you break down code into smaller pieces and then moves those pieces to a different method, and fragmented code is replaced with a call to the new method
  • reduce by abstraction, when you try to reduce the amount of duplicate code. This is done when there is a large amount of code to be refactored
  • spray bleach on "code smells", when you identify parts of "code-smells" and try to improve their understandability and debuggability by "bleaching-out" the dirty heuristic feeling that something might be wrong, even though you may have no evidence that the problem already exists.
  • combo-compose, when you "streamlines code" to reduce duplicates using multiple refactoring methods, including extract-and-distill and green-inline

edit:
myDiff is not able to identify any of these code refactoring techniques, it only notices that the AST is different.
If anything, it is what I write in the commits on Git :D
« Last Edit: February 28, 2025, 02:36:10 pm by DiTBho »
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: Wilson__

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5090
  • Country: gb
Re: please advise linux differnce program to compare old vs up graded files
« Reply #27 on: February 28, 2025, 02:32:27 pm »
On windows i use WinMerge
...
I wonder if there is something simillar in linux

Have you looked at Beyond Compare? Fairly similar ui and feature set, and cross platform implementation for win, mac, and linux. It's not free, but well worth the modest cost, imho.
several times. Didn't like it. Have you tried winmerge?

What don't you like about Beyond Compare?
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: Wilson__

Online abeyer

  • Frequent Contributor
  • **
  • Posts: 934
  • Country: us
Re: please advise linux differnce program to compare old vs up graded files
« Reply #28 on: February 28, 2025, 07:35:57 pm »
several times. Didn't like it. HAve you tried winmerge?

I have, and have nothing against it. If I were windows-only, or even windows-mostly, I might use it more... but the big value BC brings to me is that it's good enough, and has minimal differences moving back and forth between windows and linux.
 
The following users thanked this post: Wilson__

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3910
  • Country: it
Re: please advise linux differnce program to compare old vs up graded files
« Reply #29 on: February 28, 2025, 07:37:26 pm »
On windows i use WinMerge
...
I wonder if there is something simillar in linux

Have you looked at Beyond Compare? Fairly similar ui and feature set, and cross platform implementation for win, mac, and linux. It's not free, but well worth the modest cost, imho.
several times. Didn't like it. Have you tried winmerge?

What don't you like about Beyond Compare?

UI, graphics, didn't bring anything to the table over winmerge, at least for my usecase
 
The following users thanked this post: Wilson__

Online abeyer

  • Frequent Contributor
  • **
  • Posts: 934
  • Country: us
Re: please advise linux differnce program to compare old vs up graded files
« Reply #30 on: February 28, 2025, 07:46:17 pm »
I certainly don't feel like complaining, but if I really have to, it's for posts like yours, which distort what I write.

I don't think your post was "sarcastic", but why do you have to put words in my mouth that I didn't write?
I just wrote that it's written in rust, it's a fact.

I apologize if I read more than intended into what you said... but you didn't just say "it's written in rust", your exact reply was

dev-util/difftastic is written in rust  :o :o :o

And those emoji seem to pretty clearly emote some additional judgement, even if you didn't spell it out. And I didn't ask why or what that was, simply offered my opinion that it seemed like a pretty good use case for rust from my perspective, and you volunteered your issues.

Again, I didn't intend to put words in your mouth, but even after rereading the thread, I still came away with the same interpretation of what you'd written. I phrased it a bit more colorfully, perhaps, but was trying for an honest paraphrase of what I interpreted as your standpoint. Again, sorry if I misread that, but take it for what you will that it still comes across that way to me.

Talking about my experiments on Catalyst, Rust is rather experimental, not enough stable for an Overlay.

Fair enough. I'm not very plugged in to the gentoo world... but what I hear is that they have some pretty fundamental philosophical/architectural differences with the rust ecosystem and have kind of worked at cross-purposes at times, leading to a not great experience for gentoo users adopting rust.
 
The following users thanked this post: Wilson__

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5090
  • Country: gb
Re: please advise linux differnce program to compare old vs up graded files
« Reply #31 on: February 28, 2025, 09:11:23 pm »
And those emoji seem to pretty clearly emote some additional judgement, even if you didn't spell it out

in reality this type of "emoji" should denote "astonishment", in fact it amazes me a lot that a tool like this is written in Rust
Especially if you think that there are very promising OS like Haiku/OS where a tool like this could help a lot and instead...
... it won't be possible to use it for a long time because on Haiku Rust doesn't run well at all and there is little interest.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: Wilson__

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5090
  • Country: gb
Re: please advise linux differnce program to compare old vs up graded files
« Reply #32 on: February 28, 2025, 09:29:51 pm »
Fair enough. I'm not very plugged in to the gentoo world... but what I hear is that they have some pretty fundamental philosophical/architectural differences with the rust ecosystem and have kind of worked at cross-purposes at times, leading to a not great experience for gentoo users adopting rust.

Yup. Same as Ada.

On gentoo Ada needs an external bootstrapper because they absolutely do not want gcc to also have "ada" as a supported language
Code: [Select]
--enable-languages=c,c++,fortran #(default)
With the default toolchain, Gcc only supports { C, C++, Fortran } and it's not easy to modify the Portage to support other languages.

clang/llvm has its reasons, and can easily have rust-front-end, but it is typically the secondary choice, perpetually experimental, read .. never integrated patches, poor support, and many difficulties, in addition to the difficult things that already have to be managed with Catalyst and stage{1..4}.

So to have Ada, you have to compile Gnat (GPL version), and to do that you need a bootstrapper, which is typically only available for a few mainstream architectures.

At the moment ...
Code: [Select]
        !system-bootstrap? (
                amd64? (
                        ${BASE_URI}/6eb6eef6bb897e4c743a519bfebe0b1d6fc409c6?filename=${BTSTRP_AMD64}.tar.gz&rand=1193
                        -> ${BTSTRP_AMD64}.tar.gz
                )
                x86? (
                        ${BASE_URI}/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=${BTSTRP_X86}.tar.gz&rand=436
                        -> ${BTSTRP_X86}.tar.gz
                )
(=dev-lang/gnat-gpl-2021-r5)

Forget { PPC, PPC64, HPPA, MIPS, SPARC, ... } ...
maybe there could be something for { ARM, ARM64 } in the past there was
maybe there could be something for { RISCV } ... but it's my speculation

So it took me 3 years to - in a completely independent manner - create a boostrapper for HPPA and MIPS32be.
Surely, given how much it cost me, and the little interest I saw, I would not even think about finding a similar solution to also support Rust.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: Wilson__

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4640
  • Country: us
Re: please advise linux differnce program to compare old vs up graded files
« Reply #33 on: March 04, 2025, 02:46:58 am »
Quote
...diff is the standard...
Yep, and it's pretty good, and it's output is suitable input for "patch"

Note that diff has MANY options that are helpful (like, ignoring case, blank lines, or all white space, with varying amounts of "context" or each side of things marked as different.)  (read the man page!)
 
The following users thanked this post: Wilson__

Offline Simmed

  • Frequent Contributor
  • **
  • Posts: 680
  • Country: 00
Re: please advise linux differnce program to compare old vs up graded files
« Reply #34 on: March 04, 2025, 03:12:10 am »
this thing is called FFS  :P (there is linux version)
there is a function to compare by filesize / filecontent ?
not bad really

however since you are only comparing
this has a dangerous sync button

if you accidently press sync  :o
i dont think there is undo
but maybe manual restore i dont know





for those who didnt know
it shows a list of files that are found different

before you sync it, you press compare
after compare you can scroll and browse
then you can change the compare list, which to exclude etc
then you choose sync
sync and compare are 2 different actions
« Last Edit: March 04, 2025, 11:09:08 am by Simmed »
 
The following users thanked this post: Wilson__

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17774
  • Country: fr
Re: please advise linux differnce program to compare old vs up graded files
« Reply #35 on: March 04, 2025, 10:09:43 am »
It's a file sync program, not a diff. It will sync if files are detected different, but it won't give you a list of differences inside each file like a diff does.
I've used FreeFileSync on Windows.
Linux users will probably use rsync instead, or Unison if they want something with a GUI.
 
The following users thanked this post: Wilson__

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5090
  • Country: gb
Re: please advise linux differnce program to compare old vs up graded files
« Reply #36 on: March 04, 2025, 11:15:08 am »
@SiliconWizard
Is mydiff good enough for refactoring?
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: Wilson__

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5733
  • Country: Earth
Re: please advise linux differnce program to compare old vs up graded files
« Reply #37 on: March 04, 2025, 11:58:01 am »
for those who didnt know
it shows a list of files that are found different
before you sync it, you press compare
after compare you can scroll and browse
then you can change the compare list, which to exclude etc
then you choose sync

there is no need to use such programs, meld already support such operations, just run it with two folders and it will show you different files, then you can merge each file step-by-step, or just copy file from one panel to another.
 
The following users thanked this post: Wilson__


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf