Skip to content

Diff merge #71

Description

@prettydiff

I will add a merge capability to the tool. I am still thinking through how this will work while currently supporting the existing features. Any creative suggestions will be considered. A fantastic example of click to merge: http://kccode.googlecode.com/svn/trunk/source/diff/diff.html

Current thinking:

  • the diffcli option will not get merge capability
  • full merge to merge all changes from right to left or left to right
  • A click to merge capability in the output HTML diff report

Unrelated:

  • In the side-by-side view I need to add folding in the HTML diff report for consecutive inserted and deleted lines.
  • In the side-by-side view I need to add a convenient means of sliding the scrollbar to the third column

Activity

  1. Announcement commented on May 10, 2015

    @Announcement

    a pretty website...

  2. prettydiff commented on May 13, 2015

    @prettydiff
    OwnerAuthor

    @Announcement brainstorming new presentation is a very low priority for me. You can raise the priority of this issue by recommending a proposal, though.

  3. modified the milestones: 1.11.14, V2.0.0 on May 18, 2015
  4. ioferreira commented on May 28, 2015

    @ioferreira

    Hi, I suggest the HTML 4 Strict to XHTML 1 Transitional (or another more appropriate) transformation including some single tags ended with and changing the !DOCTYPE line. You did an amazing job with this, and now I'm satisfied with my early confused Kompozer source-code. Thanks!

  5. prettydiff commented on May 29, 2015

    @prettydiff
    OwnerAuthor

    Priorities and roadblocks before work on v2 can start:

    1. New markup parser
      • single unified parser for all markup related tasks
      • parser will produce parallel arrays resembling the structures used in the jspretty and csspretty libraries
      • cleaner and more modular code for both the parser and the beautifier
    2. Write a single CSV parser that conforms to the jspretty/csspretty parsing model.
    3. Build a test harness for automated unit tests of the node-local.js file (node api)
      • test each options: defaults, accepted values, and rules/constraints
      • test each output option against dummy code/dummy files
      • test each supported mode against each output option
    4. Build a test harness for prettydiff code that can run based upon the node-local test harness
      • unlike the node-local test harness this one will only be populated with simple foundational tests. This can be updated over time and hopefully with support from users.

    The end result is to have a single uniform parsing model so that the diff library can operate against parsed tokens from a list instead of comparing beautified code. The goals:

    • Allow potential for >2 way diff as a possible future enhanement
    • Allow for greater precision in code analysis
    • Allow for diff merge in a very language aware means
    • Allow for superior automation potential both on the command line and in the browser
  6. bobtherobot commented on Jun 4, 2015

    @bobtherobot

    Maintain HTML br like comments, so br's don't add to the indentation.

  7. murrayju commented on Jun 9, 2015

    @murrayju

    I would like to see better support for using prettydiff as a tool in automated tests. Basically, I need to test that some xslt produces the correct xml output. So I'm comparing the expected result with the computed output. I would like to be able to get back a simple "yes they are equal", or "no they are different (here are some line numbers)". With the current js api, the output is a DOM object, and I have to walk the DOM to extract this information. So it is currently possible, but very ugly and brittle.

  8. Myp3ik commented on Jun 10, 2015

    @Myp3ik

    Hello. You could add case-insensitivity option to diff.

  9. prettydiff commented on Jun 10, 2015

    @prettydiff
    OwnerAuthor

    @bobtherobot I will absolutely ensure that functionality is retained. I am almost ready to demo my new markup parser and I will let you know when it is ready.

    @murrayju Have you tried using Pretty Diff with Node.js and using the diffcli? It produces output similar to git diff. If this still does not address your concerns please let me know and we can discuss how to make this better.

    @Myp3ik Absolutely. I am almost ashamed I had not thought to add that before. I would likely only limit this to markup languages and string types in JavaScript.

  10. murrayju commented on Jun 10, 2015

    @murrayju

    @prettydiff I may be missing something, but I don't think that will do what I need. I'm running my tests in the browser (via Karma + Jasmine), so the node package won't work there. I'm also not comparing files so much as strings (generated by my code).

    What I'm really asking for is a simple way to make my test pass or fail. A simple api like:

    result = prettydiff({...});
    // test assertion
    expect(result.differences).toBe(0);
    

    When there are differences (and my test fails), it would be helpful for debugging purposes if I could also output some simple text to the console, showing me where the problem is. I really do like the colored output of your diffcli, so it would be great if that could end up in my Karma log.

  11. 20 remaining items

  12. orbitbot commented on Mar 9, 2016

    @orbitbot

    For the PrettyDiff website, the ability to point at URLs directly in the interface without having to download and then upload source code. I recently had to compare changes in a situation where a repository had been extracted from a larger one, so being able to point at Github's raw textfiles would have been extremely handy.

  13. prettydiff commented on Mar 9, 2016

    @prettydiff
    OwnerAuthor

    @orbitbot That is a defect. Please try it now.

  14. prettydiff commented on Mar 9, 2016

    @prettydiff
    OwnerAuthor
  15. orbitbot commented on Mar 9, 2016

    @orbitbot

    Your link works, but I am not able to get it working with entering URLs and selecting plain text. To be clear, I entered both URLs before changing the language selection. Result:

    screen shot 2016-03-09 at 18 31 13

    Fundamentally, I would also say that this functionality exists in the first place is not obvious from the interface, which is why I posted the issue in the first place (came across this tool just a day or so ago).

  16. prettydiff commented on Mar 9, 2016

    @prettydiff
    OwnerAuthor

    @orbitbot I just tried it and it worked for me. I am thinking you might have old code cached in your browser. Try a hard refresh

    • shift + F5 in Windows Chrome, Safari, or Opera
    • ctrl + F5 in Windows Firefox
    • shift + cmd + r in OSX

    Also, try it as JavaScript. I was pleasantly surprised by the result. I cannot yet recommend JavaScript language processing for Java code, but in this case it works out perfectly.

  17. orbitbot commented on Mar 9, 2016

    @orbitbot

    @prettydiff Ok, that seems to work, I guess I had the previous code for the page in my cache.

  18. prettydiff commented on Mar 30, 2016

    @prettydiff
    OwnerAuthor

    Closing. A breaking change to the output format is coming. For more information please see #292

  19. removed this from the V2.0.0 milestone on Mar 30, 2016
  20. changed the title [-]Pretty Diff 2.0 - Diff merge[/-] [+]Diff merge[/+] on Aug 4, 2016
  21. Trend74X commented on Jun 25, 2019

    @Trend74X

    @prettydiff its a bit late to ask a question but i am using prettydiff in a browser using js/browser.js I got the difference using prettydiff() function but i wanna show it in a popup window as shown in your website. is it possible to do so by codes alone which are already in it?

  22. prettydiff commented on Jun 25, 2019

    @prettydiff
    OwnerAuthor

    @Trend74X you can control that in your own front-end just as the Pretty Diff web tool is a separate library from the core prettydiff code. So prettydiff() returns a string, so just redirect that string into some container such as innerHTML of a div.

    Please let me know if that fails to answer your question.

  23. Trend74X commented on Jun 25, 2019

    @Trend74X

    @Trend74X you can control that in your own front-end just as the Pretty Diff web tool is a separate library from the core prettydiff code. So prettydiff() returns a string, so just redirect that string into some container such as innerHTML of a div.

    Please let me know if that fails to answer your question.

    Yes I am redirecting it to innerHTML right now, but its not what I wanted. I want to use popup as in your website using webtool. js is it possible?

  24. prettydiff commented on Jun 25, 2019

    @prettydiff
    OwnerAuthor

    Oh, I see. You can copy/paste code from my front-end library to use as your own. Look for these:

    That is probably all you need, but feel free to browse through the prettydiff-webtool.ts file if there anything else you want to pick at. The file is pretty easy to read and well organized as modular components once you get past the initialization code and loading function at around line 2508.

    I don't mean to be a stick in the mud, but next time please open questions as new issues. I appreciate all questions and interest in the project and am eager to help. In this case this thread contains lots of history, sends notifications to many users, and side conversations can be distracting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions