import os, times import nimgit if paramCount() == 0: echo "No git-repo given." quit(QuitFailure) discard git_libgit2_init() try: var gitRepository = openGitRepository(paramStr(1)) let gitRevisionWalker = gitRepository.walk() gitRevisionWalker.sort(GIT_SORT_TOPOLOGICAL) gitRevisionWalker.pushHead() echo "Commits on HEAD in repo: " & $gitRepository for gitOid in gitRevisionWalker: let commit = gitRepository.lookupCommit(gitOid) author = commit.author committer = commit.committer parentCount = commit.parentCount signature = commit.gpgSignature tree = commit.tree echo "===================" echo "hash: " & $gitOid echo "committer: " & committer.name & " <" & committer.email & ">" echo "author: " & author.name & " <" & author.email & ">" echo "when: " & $commit.time echo "message: " & commit.summary echo "tree id: " & $commit.treeId echo "parentCount: " & $parentCount for parentId in commit.parentIds: echo "parent: " & $parentId if signature[0] != "": echo "signature: " & $signature echo "" free(tree) free(commit) free(gitRepository) except: echo "Error:\n", getCurrentExceptionMsg()