Code Monkey home page Code Monkey logo

Comments (8)

tclem avatar tclem commented on August 27, 2024

You might take a look at https://github.com/nulltoken/libgit2sharp/commits/topic/status. This functionality is currently a WIP.

from libgit2sharp.

nulltoken avatar nulltoken commented on August 27, 2024

@renald full Diff is not available yet. However, provided all you want is a list of list of new/modified/removed files between two commits, you might more or less achieve your goal with the following recipe:

  • retreive two commits (A and B)
  • recursively walk their tree entries
  • compare tree entries by type, name and, for blobs, by oids
    • same oids, same names -> no change
    • same oids, different names -> renamed
    • same name, different oids -> modified
    • similarly you should be able to detect added and removed files

If you're after the list of modified files one is about to commit, then @tclem hint is the way to follow. I hope it won't be long before it gets merged.

Hope this helps.

from libgit2sharp.

Rdot avatar Rdot commented on August 27, 2024

Hello - Has this issue been added to the libgit2sharp source?

I want to get just the files modified during a commit, something like the git command

git show --pretty="format:" --name-only sha.

Thanks,

from libgit2sharp.

nulltoken avatar nulltoken commented on August 27, 2024

@Rdot Maybe this test would fit your need.

It demonstrates how to compare two commit trees, and, more specifically, the current Head against its parent.

Of course, by peeking at the others tests in the file, you'll see that you can compare any couple of Trees within the boundary of the Repository.

from libgit2sharp.

Rdot avatar Rdot commented on August 27, 2024

@nulltoken Very awesome, exactly what I needed. Thanks for the link 👍

from libgit2sharp.

bashtavenko avatar bashtavenko commented on August 27, 2024

This is nice, but how can get the number of lines added, deleted modified for the given sha? (git show -w -C -shortstat ..)

from libgit2sharp.

nulltoken avatar nulltoken commented on August 27, 2024

@StanBPublic We try to keep the tracker for issues and features. Could you please direct this question to StackOverflow (there's a libgit2sharp tag). We'll be happy to answer you there.

from libgit2sharp.

ColinNg avatar ColinNg commented on August 27, 2024

Hi, I think the original question isn't actually answered.
The Hitchhiker's guide on [git-log-name-status] (https://github.com/libgit2/libgit2sharp/wiki/git-log-name-status) returns a different list of files than what I get through:
git log --name-only 0138ef5..899809f
It also takes a LOT longer than git log --name-only (instant) vs. 20.633 seconds.
I have also tried StackOverflow

from libgit2sharp.

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.