diff options
Diffstat (limited to 'repo-access.sh')
-rw-r--r-- | repo-access.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/repo-access.sh b/repo-access.sh index 6e5b481..dbf1b58 100644 --- a/repo-access.sh +++ b/repo-access.sh @@ -44,3 +44,39 @@ function systr_repo_resolve_reference ssh "$remote" "systrunk resv-ref \"$symref\" \"$path\"" fi } + +## +# systrunk log [<commit>=BASE] +# +# View commit history. Generates a dump of all commits reachable +# from the given commit, or BASE if no argument given. Works for +# either local/remote repository. +## +function systr_repo_generate_log +{ + if [ $# -lt 1 ]; then + commit="$BASE" + else + commit=$(systr_repo_resolve_reference "$1") + fi + + if [[ "$remote" == "" ]]; then + while [[ "$commit" != "NULL" ]] + do + read date <"$path/revs/$commit/.date.systr" + read author <"$path/revs/$commit/.author.systr" + read email <"$path/revs/$commit/.email.systr" + + printf '%s %s\n' "$commit" "$date" + printf '%s %s\n' "$author" "$email" + echo "" + cat "$path/revs/$commit/.mesg.systr" + echo "" + echo "" + + read commit <"$path/revs/$commit/.commit.systr" + done + else + ssh "$remote" "systrunk log \"$commit\"" + fi +} |