Re: Diff Differ Project Coordination



Yeah, ultimately they're would be four files, and they would represent, for the use-case that I'm designing this for:
  1. A1: The beginning of the branch
  2. A2: The end of the branch
  3. B1: Master before the changes from the branch
  4. B2: Master after the changes from the branch
A1 and A2 would be diffed, then B1 and B2, and then the diffs would be diffed. If there are any differences, this might indicate that some change was missed. It would also be useful for joining any two branches together, whether remastering or merging, though often there there is a common file and a 3-way compare can be used.



I'd add it as a fourth option on new tabs, alongside "File", "Folder", and "Version Control". Working label is "Diff", but I don't particularly like it.

Once clicked, you'd get a couple combo boxes that would each let you pick, depending on how much I get done:
  • An existing File diff
  • "Pick Two Files", whereupon it would be replaced with two drop-downs for files, ideally with a way to go back. If the user chose this for both then yes, they'd pass in four files.
  • An existing diff of another type
    • If one was a File diff and one wasn't, the resulting tab would be an intermediate tab that lets you pick the second File much like those tabs currently let you pick the only File.
    • If both were not Files, I'm not sure what to do:
      • You would probably pick a diff in each and click Compare to compare those diffs.
      • Maybe it would calculate the Diff Diff of the Folder/Version Control.
        • Currently a stretch, but if it's easy by then or I'm motivated, I might do this
        • It would first check that the same files were added or removed
        • Then it would go through all the diffs to make sure that they are the same from one side to the other
        • From the results, the user could pick which diff diff you wanted to look at
        • Maybe there would be a way to look at a single diff, but I haven't thought of an elegant way to display that option
        • Scroll lock for these would be nice if possible
        • Ideally, the user'd be able to select two differently-named diffs, but that would probably involve solving issue #11, which is yet more of a stretch
  • "New Diff"
    • The resulting tab would have that half filled by the New Tab options (minus the new Diff option)
    • If both halves where New Diff, the user would have to select both to compare
    • Otherwise, this would be an intermediate tab like above, perhaps before one of the intermediate tabs above.
    • This is my least favorite, but might be easiest

Once the user got to the diff of the File diffs, they'd see:
  • A diff of the patches, two panels side-by-side like normal (Line numbers would be ignored and maybe removed)
  • Maybe have a patch of the patches in a short full-width panel underneath the diff of patches
    • I'd want the user to be able to hide it easily, perhaps by a draggable bar between them or a rotating triangle, or if necessary a button or checkbox
    • Keeping it in sync with the changes above would be nice, but one more option to display
    • Ideally the user'd be able to move it to the top or bottom of the screen, but if it is stuck at the bottom, that's fine
    • The things needed to do this are similar to those needed to add patches to normal File diffs; I'd probably do that if I went through all this work and it was as similar as I'm imagining
  • Perhaps at the top have the two diffs side-by-side
    • Would benefit from all the optional features of the patch at the bottom, but syncing would be harder
    • I'd try to figure out a scroll lock solution but that's tough since much of code between the two sets of diffs would be different, just unchanged in its pair
    • Probably wouldn't add meta-blocks around the blocks of changes showing how they have changed; that's just too confusing. But if I think of a good way to display that information, I might.
    • If I get the gumption, connect the differences in these to the patches. This would open up the possibility of having that the patches below diffs and in sync in regular File diffs. It might open it up for Folder diffs and Diff diffs too. Definitely a stretch, though.

I also make all the files read-only by default, perhaps with a setting to change that default.


I'll plan on just making my own fork for now. I'll try to incorporate anything that makes sense in base Meld, like adding patches under diffs or having a read-only-by-default option. I think ideally I'd make a plugin, but plugin support seems very difficult to add, and so it's probably not worth it. (If I'm wrong about this, let me know. I'd be willing to do the work to add plugin support if it's not too difficult, though that'd still entail some guidance and help with code on your part.) Other than plugin support, I haven't run across anything that needs changing to make my stuff easier, but I'll let you know.


I am having trouble using Glade. It says, "Failed to load [path]\meld\resources\ui\appwindow.ui. The following required catalogs are unavailable: meld.ui.gladesupport.", and when I open new-diff-tab I get "Unable to create object with type MeldFileChooserDialog". I see there's a \meld\ui\gladesupport.py, but I don't know how to use it or if that's what I need.

Thanks for the help, and for all the dev on Meld. It was the best differ I found to base this off of.

Have a stupendous day!

Sincerely,
Waldo


On Sun, Mar 29, 2020 at 4:20 PM Kai <kai willadsen gmail com> wrote:
On Wed, 25 Mar 2020 at 13:36, Waldo Withers via meld-list <meld-list gnome org> wrote:
Hi y'all,

I'm thinking to use Meld as the basis for a diff differ, and I was wondering if I could coordinate with some of y'all. I presume Kai, but maybe others as well.

Specifically, the diff differ would take in two sets of files or two comparisons you've done and diff their patches. This would be useful, for example, for when you are merging into master and need to make sure the changes you made since the beginning of your branch are reflected in master before you commit. On many occasions I've opened up two diffs and compared them by eye, and that's dumb; it should be automated.

I definitely understand your motivation, though I'm not entirely sure I get what the workflow will look like. Would the user pass in... four files? and what does each input represent here?
 
Anyway, I've been working on this for a bit, getting my head around the code, and I figure it'd be best to coordinate with y'all so the changes I make can eventually be integrated into Meld proper and make sense both architecturally and for the long-term vision.

So I really, *really* don't want to discourage you, but I also have to say that I'm currently struggling to get enough spare time & energy to maintain Meld's current scope, so incorporating new things is definitely likely to be slow going. There's also the question of how to add extra functionality without complicating the interface, which is usually the hardest part.

That said, I'm always extremely happy to help out with guidance around the code and what not, and I'm very willing to look at WIP patches or similar if you'd like some feedback.

If you have any specific questions about how to integrate things, or if there's functionality/classes that I could split in Meld to make stuff easier for you, please let me know.

cheers,
Kai


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]