libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.16k stars 889 forks source link

List modified files for a commit #59

Closed ghost closed 13 years ago

ghost commented 13 years ago

Hi, How to, with a specific commit, get a list of modified files?

Thanks

tclem commented 13 years ago

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

nulltoken commented 13 years ago

@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:

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.

Rdot commented 11 years ago

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,

nulltoken commented 11 years ago

@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.

Rdot commented 11 years ago

@nulltoken Very awesome, exactly what I needed. Thanks for the link :+1:

bashtavenko commented 9 years ago

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

nulltoken commented 9 years ago

@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.

ColinNg commented 6 years ago

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