コード例 #1
0
    public static void LoadCommitsFromDateToDate(string [] repositoriesAbsolutePath, GitDateFormat dateFromFormat, GitDateFormat dateToFormat, out List <LogCommitReceived> commits, out List <WindowCMDCallback> callbacks, int maxToRecover = 50000)
    {
        callbacks = new List <WindowCMDCallback>();

        List <LogCommitReceived> receivedCommits = new List <LogCommitReceived>();

        commits = new List <LogCommitReceived>();
        for (int i = 0; i < repositoriesAbsolutePath.Length; i++)
        {
            WindowCMDCallback callback;
            QuickGit.LoadCommitsFromDateToDate(repositoriesAbsolutePath[i], dateFromFormat, dateToFormat, out receivedCommits, out callback, maxToRecover);
            callbacks.Add(callback);
            commits.AddRange(receivedCommits);
        }
    }
コード例 #2
0
    public static void LoadCommitsFromDateToDate(string repositoryAbsolutePath, GitDateFormat dateFromFormat, GitDateFormat dateToFormat, out List <LogCommitReceived> commits, out WindowCMDCallback callback, int maxToRecover = 50000)
    {
        commits = new List <LogCommitReceived>();

        string cmd = string.Format("git log --after=\"{0}\" --before=\"{1}\" --pretty=format:\"%H|%an|%ae|%ad|%s\" --date=format:%Y:%m:%d:%H:%M:%S:%z -n {2}",
                                   dateFromFormat.GetGitTimeFormat(), dateToFormat.GetGitTimeFormat(), maxToRecover);

        WindowCMD.RunCommands(new string[] { cmd }, repositoryAbsolutePath, false, out callback);
        string[] receivedLines = callback.GetReceivedTextAsLines();
        Debug.Log("Received Lines:" + receivedLines.Length);
        Debug.Log("Cmd:" + cmd);
        for (int i = 0; i < receivedLines.Length; i++)
        {
            //3a8c1a82146c13cb9e26359aaa73d49b9c81ca84|ddd|[email protected]|2020:06:19:09:53:30:+0200|Commit
            //50d63eb71ce042349f45ba4a3bd80da925bac915|Eloi Stree|[email protected]|2020:06:19:07:36:50:+0200|Commit
            string[] lineTokens = receivedLines[i].Split('|');
            if (lineTokens.Length == 5)
            {
                LogCommitReceived commit;
                ConvertTableToCommitFromStringOfConsole(lineTokens, out commit);
                commits.Add(commit);
            }
        }
    }