GitLog() for sub directory #3107
-
I can't make GitLog alias work for a subdirectory in my repository. from git command line I would have written this:
Anybody know a way to do this? Or if it's supported at all? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
At a quick glance I would say it is currently not possible using StartProcess("git.exe", new ProcessSettings {
Arguments = "log -- mysubfolder",
WorkingDirectory = "c:\\repos\\myrepo"
}); Obviously this would only be a crude workaround, so I would suggest you raise a ticket with Cake_Git. (Of course PRs are always welcome 😉 ) |
Beta Was this translation helpful? Give feedback.
-
Cake.Git is basically just a wrapper around LibGit2Sharp. As a workaround if there's currently no alias available you can use LibGit2Sharp directly, after adding the Cake.Git addin: using (var repo = new Repository(@"c:\repos\myrepo"))
{
IEnumerable<LogEntry> history = repo.Commits.QueryBy(@"mysubfolder");
} As a second step you can provide a PR to Cake.Git to add an alias around the specific functionality, and once this is merged and released, you can remove the direct calls to LibGit2Sharp in your script, with the alias from Cake.Git. |
Beta Was this translation helpful? Give feedback.
Cake.Git is basically just a wrapper around LibGit2Sharp. As a workaround if there's currently no alias available you can use LibGit2Sharp directly, after adding the Cake.Git addin:
As a second step you can provide a PR to Cake.Git to add an alias around the specific functionality, and once this is merged and released, you can remove the direct calls to LibGit2Sharp in your script, with the alias from Cake.Git.