Giter Site home page Giter Site logo

Implement core diff protocols about libgit2 HOT 10 OPEN

hausdorf avatar hausdorf commented on September 18, 2024
Implement core diff protocols

from libgit2.

Comments (10)

hausdorf avatar hausdorf commented on September 18, 2024

Andrew and I were poking around in git today. The places you will want to look are the diff* src files (e.g., diffcore-pickaxe.c, diff.c, and so on). Particularly useful as a place to start may be delta.h, as this houses the comments for the functions that occur in these diff* files. The function create_delta() seems promising, and is declared in delta.h and implemented in diff-delta.h.

What seems to be happening here is that files and commits are stored in the index -- note that this is not a number, but a struct, and appears to be very similar, if not the same thing as the index that you add files to when you run git add [filename] (i.e., this command puts a file in git's index).

Hope this helps!

from libgit2.

basepi avatar basepi commented on September 18, 2024

Yep, we'll look through that stuff. Landon and will probably get together this weekend -- I have a physics midterm and non-school stuff to do until Friday afternoon or so, so I won't be able to dedicate much time to this until then.

from libgit2.

trane avatar trane commented on September 18, 2024

We found where you guys should start looking. It is in the git repo, "git/builtin/diff.c".
This contains all of the methods that can be called when a 'git diff ...' command is issued and should be the primary reference source of what you guys will be supplying for third party interaction between our diff implementation(s) and the user linking libgit2.

from libgit2.

trane avatar trane commented on September 18, 2024

Alright, guys. Here is the KEY to your implementation... in

builtin/diff.c
the function
cmd_diff
(the last function) contains the comment of how the command-line options correspond to specific function calls.

from libgit2.

hausdorf avatar hausdorf commented on September 18, 2024

You may have noticed that comments are sparse in the git source. Here is the cure:

Documentation/technical

Inside is a shit-ton of API .txt files that explain everything. Diff, merge, whatever. This is what you guys need to do your job.

from libgit2.

hausdorf avatar hausdorf commented on September 18, 2024

Morning yet again, gentlemen. In today's exciting installment of "Andrew and Alex do your jobs for you", we will point you to a specific file that is (we think) the crux of your problem:

xdiff-interface.c

So remember, the goal here is to implement all the features needed to diff. Please call me if you have any questions about how that works.

from libgit2.

hausdorf avatar hausdorf commented on September 18, 2024

Dear sweethearts,

If you were wondering, the diff function call patterns goes roughly as so, starting with the more general interface methods, and getting more specific (i.e., closer to the actual diff) as you go down the list.

  1. xdiff-interface.c -> xdi_diff() -- the interface method used by git to interact with xdiff's diffing functionality
  2. xdiff/xdiff.c -> xdl_diff() -- sets up initial diff requirements, decides whether or not to use patience
  3. xdiff/xdiff.c -> xdl_do_diff() -- sets up more specific requirements for diff stuff
  4. xdiff/xdiff.c -> xdl_recs_cmp() -- diffs and passes diff into the diffdata_t
    parameters, method name means "recursively compare" FYI

Love,
Alex and Andrew

from libgit2.

hausdorf avatar hausdorf commented on September 18, 2024

@kyeana, you were talking about windows/unix interface. Just FYI, the win32/ folder I think houses the official windows interface, while the unix/ folder houses the unix stuff.

from libgit2.

hausdorf avatar hausdorf commented on September 18, 2024

Addendum: they both appear to implement the map.h file from src/. So my guess is you can just access the windows or unix API through the interface defined in map.h and let a #define or something handle which file it is that you compile that for. Or maybe that's actually handled by waf. I dunno.

from libgit2.

hausdorf avatar hausdorf commented on September 18, 2024

Also, it appears that you can access this functionality via src/dir.h.

from libgit2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.