please advise linux differnce program to compare old vs up graded files - Page 1
Forum section: electronics / general

author: Wilson__
author_rank: Frequent Contributor
timestamp: February 26, 2025, 12:45:59 pm
content: please advise linux software for use to compare older version vs newer version of library software. Just need basic compare. Nothing special.a) clib) with graphical user interfaceAI says diff and mold. Are they good?

author: golden_labels
author_rank: Super Contributor
timestamp: February 26, 2025, 04:52:56 pm
content: Diff is the standard. With vimdiff offering a niceTUI, if you’re accustomed to vim.

author: abeyer
author_rank: Frequent Contributor
timestamp: February 26, 2025, 05:58:37 pm
content: Other nice gui options are kdiff3 (oss) and Beyond Compare (paid commercial license.) In GUI-land I tend to alternate between those and meld based on the use case. They tend to have largely overlapping functionality, but I think each has its own strengths.In the CLI space, some other options worth thinking about are: Using git-diff directly (you can use it as a standalone tool without a git repo with the--no-indexoption) specifically for its patience and histogram algorithms, which give far more readable diffs for many common types of code movement. diffoscope provides lots of support for recursively descending into various types of archive and container files, and can work alongside binwalk to compare disk and firmware images. difftastic is nice if you're using working with programming language files that have a treesitter grammar, as it will actually parse and understand the code at a structural level, and produce a more "syntactic" diff that reflects the structure of the language, rather than just a textual one.

author: madires
author_rank: Super Contributor
timestamp: February 26, 2025, 06:06:26 pm
content: With GUI: Meld

author: tunk
author_rank: Super Contributor
timestamp: February 26, 2025, 06:23:39 pm
content: You could also use the package manager of your distroto see which versions they are, and then look at thepackage source code. Or is this from some commercialsoftware?

author: Wilson__
author_rank: Frequent Contributor
timestamp: February 26, 2025, 06:59:30 pm
content: Many thanks for advises. I have two folders containing lib files. One folder was downloaded time ago. The other folder is latest.Tried a few and IMHO text base simple tools is easiest

author: eutectique
author_rank: Frequent Contributor
timestamp: February 26, 2025, 07:00:14 pm
content: Quote from: Wilson__ on February 26, 2025, 12:45:59 pmWhat do you want to compare exactly? Two zip archives? Two .tgz archives? Two system logs? Two git repositories? Two shared library files -- binaries or disassembly?Each use case would have a tool best suited for the task.Quote from: Wilson__ on February 26, 2025, 12:45:59 pm"Basic compare, nothing special" would be diff. But you might not be satisfied with the result.

author: eutectique
author_rank: Frequent Contributor
timestamp: February 26, 2025, 07:07:39 pm
content: Quote from: Wilson__ on February 26, 2025, 06:59:30 pmmeldis good showing directories. Are you lib files text of binary? If the former, meld would show you the differences. If the latter, you will only see "binary files are different". They could have the same .text sections (I am speculating, you did not tell the details) but different time stamps. So, having the same code, they will technically be different.

author: Wilson__
author_rank: Frequent Contributor
timestamp: February 26, 2025, 07:25:58 pm
content: Many thanks for advises. I have an older and newer folders. For two versions of a source code lib. All plain text source files.

author: tggzzz
author_rank: Super Contributor
timestamp: February 26, 2025, 08:26:46 pm
content: Meld, for manual inspection of differences

author: radiolistener
author_rank: Super Contributor
timestamp: February 26, 2025, 10:27:10 pm
content: git for version tracking, meld for text file comparisonwhen the folder is under git control, you can just type ```git status``` to get modified file list, or start meld with current folder as argument, it know how to obtain file status from git.

author: Wilson__
author_rank: Frequent Contributor
timestamp: February 26, 2025, 10:48:39 pm
content: Quote from: radiolistener on February 26, 2025, 10:27:10 pmIs that for git running on my local linux machine and not github? I just trying to setup and not used git nor github (apart from downloading) before

author: radiolistener
author_rank: Super Contributor
timestamp: February 27, 2025, 12:20:18 am
content: Quote from: Wilson__ on February 26, 2025, 10:48:39 pmgit just allows you to track your local file changes, so you can see all commit history for the file, you can compare two different commits, you can revert back to any version, then restore latest version, etc. Then when you need you can push all your local commits to a server repository and obtain all server commits to your local git. But you can do tracking without pushing to the server, just locally.If you want just to compare two text files, then simply type meld <file1> <file2>Meld also support folder comparison, so you can pass two folders as argument.It also allows to compare 3 files, just pass 3 files as command line argument.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 27, 2025, 05:32:39 am
content: I also use Meld as a GUI diff. Note that it's also available on Windows, if you use that:https://meldmerge.org/On Windows, I used to use WinMerge otherwise:https://winmerge.org/

author: JPortici
author_rank: Super Contributor
timestamp: February 27, 2025, 10:13:16 am
content: On windows i use WinMergeLove it!Compare 2/3 files, or 2/3 folders, can recognize automatically if there is an archive (zip, rar, xlsx, ...) and operate on the archive data, or directly the binaryI use it for everything that is not already tracked into GIT, or for example two different text files.Win2000 aesthetics so everything is direct and to the point.I wonder if there is something simillar in linux

author: DiTBho
author_rank: Super Contributor
timestamp: February 27, 2025, 03:50:28 pm
content: dev-util/difftastic is written in rust

author: abeyer
author_rank: Frequent Contributor
timestamp: February 27, 2025, 04:33:23 pm
content: Quote from: JPortici on February 27, 2025, 10:13:16 amHave 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.

author: abeyer
author_rank: Frequent Contributor
timestamp: February 27, 2025, 04:34:19 pm
content: Quote from: DiTBho on February 27, 2025, 03:50:28 pmI'm not the "rewrite it in rust!" crowd, but given that this was a new build and the nature of what it does, seems like not a bad choice.

author: DiTBho
author_rank: Super Contributor
timestamp: February 27, 2025, 05:42:16 pm
content: Quote from: abeyer on February 27, 2025, 04:34:19 pmIt's a problem for me because I can't compile it on { HPPA, MIPS, MIPS64, ARM-v5(1), .. } due to lack of Rust compiler.(1) Zaurus GNU/Linux

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 27, 2025, 05:50:23 pm
content: Judging from what they say on their project page, you may not be missing much. It looks pumped-full of bugs.

author: abeyer
author_rank: Frequent Contributor
timestamp: February 27, 2025, 06:30:26 pm
content: Quote from: SiliconWizard on February 27, 2025, 05:50:23 pmI've used it off and on for tasks it's a good match for, and has worked well in my experience. It's clearly not (nor intended to be) a full replacement for a general textual diff, though.

author: abeyer
author_rank: Frequent Contributor
timestamp: February 27, 2025, 06:55:15 pm
content: Quote from: DiTBho on February 27, 2025, 05:42:16 pmsuppose it probably doesn't work on a UNIVAC either, huh? ¯\_(ツ)_/¯Not to betoosnarky, I'll just say I get the interest (and share it) in playing with less common/older/oddball architectures... but complaining that everyone who writes new software and gives it away for free doesn't support your particular collection of boat anchors doesn't really seem productive. (and if we're gonna complain, sparc should be higher than any of those on the list)Also, mips, mipsel, and mips64 all have at least tier 3 support in rust now... not necessarily easy to work with, but they're there.

author: DiTBho
author_rank: Super Contributor
timestamp: February 27, 2025, 08:14:13 pm
content: Quote from: abeyer on February 27, 2025, 06:55:15 pmI 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'swritten in rust, it's a fact.You asked me why this is relevant, and i said it's relevant to me, because I can't emerge it on the systems i support.Quote from: abeyer on February 27, 2025, 06:55:15 pmTalking about my experiments on Catalyst, Rust is rather experimental, not enough stable for an Overlay.

author: DiTBho
author_rank: Super Contributor
timestamp: February 27, 2025, 08:21:17 pm
content: Quote from: SiliconWizard on February 27, 2025, 05:50:23 pmYup. Same impression ...I will try it on my MacMini-2009/x86.I'm curious because I also wrote a tool like this.It only supports myC, I already talked about it in a similar topic to this one, just about tools for differences.I reused part of the myC compiler code, the lexer, and the parser, for kind of "smarter" analysis between two source files.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 28, 2025, 07:14:45 am
content: Quote from: DiTBho on February 27, 2025, 08:21:17 pmYes, 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?

author: JPortici
author_rank: Super Contributor
timestamp: February 28, 2025, 09:27:03 am
content: Quote from: abeyer on February 27, 2025, 04:33:23 pmseveral times. Didn't like it. HAve you tried winmerge?

author: DiTBho
author_rank: Super Contributor
timestamp: February 28, 2025, 02:25:42 pm
content: Quote from: SiliconWizard on February 28, 2025, 07:14:45 amYup, 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 ASTSome techniques preserve bothrenaming 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 waymyDiffcan 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 elementsextract-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 methodreduce 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 refactoredspray 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, includingextract-and-distillandgreen-inlineedit:myDiffis 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

author: DiTBho
author_rank: Super Contributor
timestamp: February 28, 2025, 02:32:27 pm
content: Quote from: JPortici on February 28, 2025, 09:27:03 amWhat don't you like about Beyond Compare?

author: abeyer
author_rank: Frequent Contributor
timestamp: February 28, 2025, 07:35:57 pm
content: Quote from: JPortici on February 28, 2025, 09:27:03 amI 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.

author: JPortici
author_rank: Super Contributor
timestamp: February 28, 2025, 07:37:26 pm
content: Quote from: DiTBho on February 28, 2025, 02:32:27 pmUI, graphics, didn't bring anything to the table over winmerge, at least for my usecase

author: abeyer
author_rank: Frequent Contributor
timestamp: February 28, 2025, 07:46:17 pm
content: Quote from: DiTBho on February 27, 2025, 08:14:13 pmI apologize if I read more than intended into what you said... but you didn'tjustsay "it's written in rust", your exact reply wasQuote from: DiTBho on February 27, 2025, 03:50:28 pmAnd those emoji seem to pretty clearly emote some additional judgement, even if you didn't spell it out. And Ididn'task 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.Quote from: DiTBho on February 27, 2025, 08:14:13 pmFair 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.

author: DiTBho
author_rank: Super Contributor
timestamp: February 28, 2025, 09:11:23 pm
content: Quote from: abeyer on February 28, 2025, 07:46:17 pmin reality this type of "emoji" should denote "astonishment", in fact it amazes me a lot that a tool like this is written in RustEspecially 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.

author: DiTBho
author_rank: Super Contributor
timestamp: February 28, 2025, 09:29:51 pm
content: Quote from: abeyer on February 28, 2025, 07:46:17 pmYup. Same as Ada.On gentoo Ada needs an external bootstrapper because they absolutely do not want gcc to also have "ada" as a supported languageCode:--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:!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 wasmaybe there could be something for { RISCV } ... but it's my speculationSo 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.

author: westfw
author_rank: Super Contributor
timestamp: March 04, 2025, 02:46:58 am
content: QuoteYep, and it's pretty good, and it's output is suitable input for "patch"Note thatdiffhas 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!)

author: Simmed
author_rank: Frequent Contributor
timestamp: March 04, 2025, 03:12:10 am
content: this thing is called FFS(there is linux version)there is a function to compare by filesize / filecontent ?not bad reallyhowever since you are only comparingthis has a dangerous sync buttonif you accidently press synci dont think there is undobut maybe manual restore i dont knowfor those who didnt knowit shows a list of files that are found differentbefore you sync it, you press compareafter compare you can scroll and browsethen you can change the compare list, which to exclude etcthen you choose syncsync and compare are 2 different actions

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 04, 2025, 10:09:43 am
content: 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.

author: DiTBho
author_rank: Super Contributor
timestamp: March 04, 2025, 11:15:08 am
content: @SiliconWizardIs mydiff good enough for refactoring?

author: radiolistener
author_rank: Super Contributor
timestamp: March 04, 2025, 11:58:01 am
content: Quote from: Simmed on March 04, 2025, 03:12:10 amthere 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.