Skip to content

Instantly share code, notes, and snippets.

@amy
Created July 7, 2017 00:54
Show Gist options
  • Save amy/ccad4e4598e7c9fe87643252f2bf9d31 to your computer and use it in GitHub Desktop.
Save amy/ccad4e4598e7c9fe87643252f2bf9d31 to your computer and use it in GitHub Desktop.
cmd := exec.Command("git", "log", "-n1", "--oneline", "--format=format:%H", fmt.Sprintf("-- /some/path/to/git/repo/%s", relativePath))
output, err := cmd.Output()
fmt.Printf("Wut: %q %v %v %v\n", relativePath, cmd.Args, err, output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment