Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
canpolat ( canpolat@programming.dev )  to Programming@programming.devEnglish · 3 years ago

Difftastic, a structural diff tool that understands syntax

difftastic.wilfred.me.uk

external-link
message-square
8
link
fedilink
  • cross-posted to:
  • git@programming.dev
79
external-link

Difftastic, a structural diff tool that understands syntax

difftastic.wilfred.me.uk

canpolat ( canpolat@programming.dev )  to Programming@programming.devEnglish · 3 years ago
message-square
8
link
fedilink
  • cross-posted to:
  • git@programming.dev
Difftastic, a structural diff tool that understands syntax
alert-triangle
You must log in or register to comment.
  • PeriodicallyPedantic ( PeriodicallyPedantic@lemmy.ca ) 
    link
    fedilink
    arrow-up
    6
    ·
    3 years ago

    Oh this is neat. I wonder if the license will accommodate my work (and my work is willing to allow a nonstandard diff)

    • nous ( nous@programming.dev ) 
      link
      fedilink
      English
      arrow-up
      15
      ·
      3 years ago

      The license is MIT, so should be fine for most things

  • AbelianGrape ( AbelianGrape@beehaw.org ) 
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    2 years ago

    How does this compare with GumTree? It’s weird that the page doesn’t even mention existing state-of-the-art tools for this task.

    edit: I’ve compared GumTree and difftastic myself while working on a project this past week. Difftastic is harder to use programatically (the JSON format is unstable and leaves something to be desired) but other than that it’s miles and miles better.

    • key ( key@lemmy.keychat.org ) 
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 years ago

      The manual talks about some of the older alternatives that influenced it. Doesn’t directly compare them though https://difftastic.wilfred.me.uk/tree_diffing.html

  • astrsk ( astrsk@kbin.social ) 
    link
    fedilink
    arrow-up
    3
    ·
    3 years ago

    I didn’t get a chance to look too deep into it, while it looks great for human reading in a terminal, can I just as easily output the diff to a patch file like I do often with ‘git diff [commit] [commit] > patch.txt and git apply it?

    • ranting_sandfish ( ranting_sandfish@mander.xyz ) 
      link
      fedilink
      arrow-up
      11
      ·
      3 years ago

      Doesn’t look like it, from their docs:

      Non-goals

      Patching. Difftastic output is intended for human consumption, and it does not generate patches that you can apply later. Use diff if you need a patch.

    • zygo_histo_morpheus ( zygo_histo_morpheus@programming.dev ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      Since the diffs are tree-sitter based, it’s interesting to think about what a tree-sitter based patch would look like. Probably wouldn’t double as a human and computer friendly format like normals diffs. I suppose that you could create patches that are more robust to the source code changing since it wouldn’t care about linebreaks and maybe you could have it so it doesn’t care if you move code around since you could have it so its going by e.g. what the parent function is and not the line number. I gotta wonder how useful that actually is though.

    • MonkderZweite ( MonkderZweite@feddit.ch ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      Use diff for that?

Programming@programming.dev

programming@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programming@programming.dev

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 153 users / day
  • 772 users / week
  • 1.89K users / month
  • 4.5K users / 6 months
  • 453 local subscribers
  • 29.2K subscribers
  • 3.08K Posts
  • 23.8K Comments
  • Modlog
  • mods:
  • snowe ( snowe@programming.dev ) 
  • Ategon ( Ategon@programming.dev ) 
  • UlrikHD ( UlrikHD@programming.dev ) 
  • bugsmith ( bugsmith@programming.dev ) 
  • Spyro ( Spyro@programming.dev ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code