Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "git log --path" #463

Closed
x-projs opened this issue Jul 11, 2013 · 8 comments
Closed

Support "git log --path" #463

x-projs opened this issue Jul 11, 2013 · 8 comments

Comments

@x-projs
Copy link

x-projs commented Jul 11, 2013

Do we support git log --path? It seems there is no path parameter in Filter. Is there another way to implement "git log --path"?

@nulltoken
Copy link
Member

Libgit2 exposes all the basic functions to make this possible, but it's not available yet in LibGit2Sharp.

@arrbee wrote some code to demonstrate how to make this happen.

@Aimeast
Copy link
Contributor

Aimeast commented Aug 16, 2013

I am waiting this parameter also, but I have some code for path filter, see https://gist.github.com/Aimeast/6250443

@Therzok
Copy link
Member

Therzok commented May 30, 2014

Can anyone assign this to me?

@dahlbyk
Copy link
Member

dahlbyk commented Jun 2, 2014

Can anyone assign this to me?

Tried but can't assign to non-collaborator. 👿

That said, it's all yours.

@Aimeast
Copy link
Contributor

Aimeast commented Jun 2, 2014

Does libgit2 already supported to the path filter?

@dahlbyk

@Therzok
Copy link
Member

Therzok commented Jun 2, 2014

@Aimeast There's no direct API for that. It can be done at a managed level by iterating commits which contain the path.

@carlosmn
Copy link
Member

This functionality was added by #963

@deepak-arya
Copy link

deepak-arya commented Jul 10, 2016

Hi @carlosmn i tried #963 but could not achieve it. below is what i am doing. can u check if i am doing it correct. help is much appreciated.

        public static void GetFileHistory(string filepath,string repopath)
        {
            using (var repo = new Repository(repopath))
            {
                // here i am using absolute file path
                IEnumerable<LogEntry> history = repo.Commits.QueryBy(filepath);
                //problem is here. it does not go into loop. 
                foreach(LogEntry e in history)
                {
                    Console.WriteLine(e.Commit.Message);
                }
            }
        }

/// here is what i get
GetEnumerator() result view is always null
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants