Skip to content

How would I do a git log --follow #893

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

Closed
jdosullivan opened this issue Dec 22, 2014 · 3 comments
Closed

How would I do a git log --follow #893

jdosullivan opened this issue Dec 22, 2014 · 3 comments
Milestone

Comments

@jdosullivan
Copy link

I'm trying to find out the log history for specific files. Git does this well with git log --follow . How can I pull off the same with lib2gitsharp. I've just looking into the code as well and trying to find the extension point. If someone knows exactly where it is I'd be more than happy to add this in, test it and send a PR.

Thanks

@Aimeast
Copy link
Contributor

Aimeast commented Dec 23, 2014

Duplicate #89, libgit2/libgit2#495, libgit2/libgit2#2217, not supported by libgit2 yet.

By the way, you will find my implementation on my project (https://github.com/Aimeast/GitCandy/blob/dev/GitCandy/Git/LastCommitAccessor.cs#L39-L77)

@carlosmn
Copy link
Member

log --follow is a very special bolted-on case, and I don't know if libgit2 will ever support it, but every piece you need is there. The log example command and libgit2/libgit2#1965 show how you go about ignoring those commits which don't touch a path. The --follow simply switches the path when you detect a rename.

ThomasBarnekow added a commit to ThomasBarnekow/libgit2sharp that referenced this issue Feb 24, 2015
This commit basically implements the git log --follow command. To do that, it
implements the FileHistory, FileHistoryEntry, and FileHistoryExtensions classes.
The associated FileHistoryFixture implements a number of tests, covering the
essential cases (e.g., following renames, dealing with branches).

Related to topics libgit2#893 and libgit2#89
ThomasBarnekow added a commit to ThomasBarnekow/libgit2sharp that referenced this issue Feb 24, 2015
This commit basically implements the git log --follow command. To do that, it
implements the FileHistory, FileHistoryEntry, and FileHistoryExtensions classes.
The associated FileHistoryFixture implements a number of tests, covering the
essential cases (e.g., following renames, dealing with branches).

Related to topics libgit2#893 and libgit2#89
ThomasBarnekow added a commit to ThomasBarnekow/libgit2sharp that referenced this issue Mar 19, 2015
This commit basically implements the git log --follow command. To do that, it
implements the FileHistory, FileHistoryEntry, and FileHistoryExtensions classes.
The associated FileHistoryFixture implements a number of tests, covering the
essential cases (e.g., following renames, dealing with branches).

Related to topics libgit2#893 and libgit2#89
ThomasBarnekow added a commit to ThomasBarnekow/libgit2sharp that referenced this issue Apr 2, 2015
This commit basically implements the git log --follow command. To do that, it
implements the FileHistory, FileHistoryEntry, and FileHistoryExtensions classes.
The associated FileHistoryFixture implements a number of tests, covering the
essential cases (e.g., following renames, dealing with branches).

Related to topics libgit2#893 and libgit2#89
ThomasBarnekow added a commit to ThomasBarnekow/libgit2sharp that referenced this issue Apr 11, 2015
This commit basically implements the git log --follow command. To do that, it
implements the FileHistory, FileHistoryEntry, and FileHistoryExtensions classes.
The associated FileHistoryFixture implements a number of tests, covering the
essential cases (e.g., following renames, dealing with branches).

Related to topics libgit2#893 and libgit2#89
ThomasBarnekow added a commit to ThomasBarnekow/libgit2sharp that referenced this issue Apr 13, 2015
This commit basically implements the git log --follow <path> command. It adds
the following two methods to the IQueryableCommitLog interface:

IEnumerable<LogEntry> QueryBy(string path);
IEnumerable<LogEntry> QueryBy(string path, FollowFilter filter);

The corresponding implementations are added to the CommitLog class. The actual
functionality is implemented by the FileHistory class that is part of the
LibGit2Sharp.Core namespace.

Related to topics libgit2#893 and libgit2#89
@nulltoken
Copy link
Member

#963 should fix this

@nulltoken nulltoken added this to the v0.22 milestone Apr 13, 2015
sgasse added a commit to sgasse/git_copyright that referenced this issue Mar 10, 2022
Using libgit2, there is no battle-proven way to follow the history of a
file through renames, see also:
libgit2/libgit2sharp#893

Consequently, we are removing libgit2 as a dependency and instead rely
on the git binary, calling it in a subprocess.

Another change in this commit is switching from `(c) Copyright` to
`Copyright (c)`.
sgasse added a commit to sgasse/git_copyright that referenced this issue Mar 11, 2022
Using libgit2, there is no battle-proven way to follow the history of a
file through renames, see also:
libgit2/libgit2sharp#893

Consequently, we are removing libgit2 as a dependency and instead rely
on the git binary, calling it in a subprocess.

Another change in this commit is switching from `(c) Copyright` to
`Copyright (c)`.
sgasse added a commit to sgasse/git_copyright that referenced this issue Mar 11, 2022
Using libgit2, there is no battle-proven way to follow the history of a
file through renames, see also:
libgit2/libgit2sharp#893

Consequently, we are removing libgit2 as a dependency and instead rely
on the git binary, calling it in a subprocess.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants