Git Product home page Git Product logo

Comments (6)

samcday avatar samcday commented on June 11, 2024

I really like the sound of this!

My plan is to implement some high level "convenience" wrappers around the gitteh bindings once they're complete. I was planning on implementing these in JS. Your ideas for revParse would be a great first step!

I like the idea of revParse processing anything - particularly if you give it any ref and it will automatically peel the ref (if it's symbolic) and load the commit.

Not too sure about resolving fragment sha1's though - libgit2 doesn't support this. I guess we could scan the git repository on the filesystem and try that - but then we'd also have to scan packfiles too.

from node-gitteh.

samcday avatar samcday commented on June 11, 2024

@TooTallNate

What do you think if we made revParse just straight up retrieve the object you provide? In such a way that it retrieves

For example:

// Gives us a Commit object.
var commit = repository.revParse("HEAD");

// Gives us the Blob for mydir/blah.txt in HEAD revision:
var blob = repository.revParse("HEAD:mydir/blah.txt");

// Gives us the Tree for mydir in the v1.0.1 tag:
var tree = repository.revParse("v1.0.1:mydir");

from node-gitteh.

mildsunrise avatar mildsunrise commented on June 11, 2024

@samcday Please, tag this as whishlist!

from node-gitteh.

mbostock avatar mbostock commented on June 11, 2024

This would be a lovely feature. I'm using node-gitteh to implement a simple git-backed static file server, and supporting sha1 fragments in particular would be handy for short URLs. Revisions of the form "HEAD~1" would also be handy for comparing the latest and previous versions.

from node-gitteh.

mildsunrise avatar mildsunrise commented on June 11, 2024

Actually, a rev-parse can be a commit, a branch, a tag, or another reference. Thus, LibGit2 will return you the object (could be a Commit, or a Reference).

from node-gitteh.

samcday avatar samcday commented on June 11, 2024

Revparsing is available in libgit2 0.18.0, so we'll be offering this functionality in node-gitteh once we've released our corresponding 0.18.0 package.

from node-gitteh.

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.