aboutsummaryrefslogtreecommitdiff
path: root/git.h
blob: 268983f3ba6a1aa4b0486e5f2d85cac5205a9143 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <string>

class GitMetadata {
public:
  // Is the metadata populated? We may not have metadata if
  // there wasn't a .git directory (e.g. downloaded source
  // code without revision history).
  static bool Populated();

  // Were there any uncommitted changes that won't be reflected
  // in the CommitID?
  static bool AnyUncommittedChanges();

  // The commit author's name.
  static std::string AuthorName();
  // The commit author's email.
  static std::string AuthorEmail();
  // The commit SHA1.
  static std::string CommitSHA1();
  // The ISO8601 commit date.
  static std::string CommitDate();
  // The commit subject.
  static std::string CommitSubject();
  // The commit body.
  static std::string CommitBody();
  // The commit describe.
  static std::string Describe();
  // The symbolic reference tied to HEAD.
  static std::string Branch();
  // dump
  static void VersionInfo();
};