APISonar


git4idea.commands.GitCommand.LOG

> git4idea > commands > GitCommand > LOG
git4idea APIs commands APIs GitCommand APIs LOG APIs

Example 1
private static String getCurrentRevision(Project project, VirtualFile root) throws VcsException {
    GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG);
    h.setNoSSH(true);
    h.setSilent(true);
    h.addParameters("--max-count=1", "--pretty=%h");
    return check_9qzcwz_a4a0(h.run());
  }
Example 2
public static String getCommitAbbreviation(final Project project, final VirtualFile root, final SHAHash hash) {
    GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG);
    h.setNoSSH(true);
    h.setSilent(true);
    h.addParameters("--max-count=1", "--pretty=%h", "--encoding=UTF-8", "\"" + hash.getValue() + "\"", "--");
    try {
      final String output = h.run().trim();
      if (StringUtil.isEmptyOrSpaces(output)) return null;
      return output.trim();
    }
    catch (VcsException e) {
      return null;
    }
  }