All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.dagere.peass.vcs.CommitUtil Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package de.dagere.peass.vcs;

import java.io.File;
import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class CommitUtil {
   
   private static final Logger LOG = LogManager.getLogger(CommitUtil.class);
   
   public static List getGitCommits(final String startversion, final String endversion, final File projectFolder) {
      final List commits = GitUtils.getCommits(projectFolder, false);

      LOG.info("Processing git repo, commits: {}", commits.size());
      // LOG.debug("First Commits: {}", commits.subList(0, 10));
      if (startversion != null) {
         if (endversion != null) {
            GitUtils.filterList(startversion, endversion, commits);
         } else {
            GitUtils.filterList(startversion, null, commits);
            LOG.debug("First Commits: {}", commits.size() > 10 ? commits.subList(0, 10) : commits.subList(0, commits.size() - 1));
         }
      } else if (endversion != null) {
         GitUtils.filterList(null, endversion, commits);
      }
      LOG.info(commits);
      return commits;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy