Comments (8)
You might take a look at https://github.com/nulltoken/libgit2sharp/commits/topic/status. This functionality is currently a WIP.
from libgit2sharp.
@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.
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.
@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 Tree
s within the boundary of the Repository
.
from libgit2sharp.
@nulltoken Very awesome, exactly what I needed. Thanks for the link 👍
from libgit2sharp.
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.
@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.
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)
- git 2.40.0 index.skipHash incompatible with libgit2sharp (please update libgit2 from 1.7.1 to 1.8.0)
- the command pull take the class Repository instead of the interface like other commands
- Security Vulnerabilities in git2-106a5f2.dll: Non-Compliance with Secure Hashing and Compiler Security Best Practices HOT 2
- Request - upgrade to libgit2 1.7.2 HOT 1
- the error "too many redirects or authentication replays libgit2shap" come up after upgrading from 0.28 to 0.30 on Fetch HOT 1
- Certificate Verification Failed "unknown certificate lookup failure" HOT 1
- Replace <PackageLicenseFile> with <PackageLicenseExpression>
- CommitLog order does not reflect order of commits.
- Error pushing to github using 0.26.2 HOT 4
- Unable to push the commit to the Bitbucket Repository in C# using LibGit2Sharp
- Exception when using it inside a Visual Studio 2022 Extensibility project HOT 6
- SSL error; syscall failure: Connection reset by peer when push 1.3 GB filesize
- Capture error details of "remote unpack failed"
- Disable SSL Certificate Check: 'unknown certificate lookup failure: 33'
- "LibGit2Sharp.LibGit2SharpException: could not initialize security context" while cloning HOT 6
- LibGit2Sharp throws an exception when discovering a git config with setting core.repositoryformatversion=1 and extensions.worktreeconfig=true HOT 1
- The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
- Consider using SafeHandle in Libgit2Object instead of void*
- Is there a way to apply a patch file into a repository by using this lib?
- LibGit2Sharp.LibGit2SharpException: could not set credentials: could not open libssl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libgit2sharp.