-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24cab23
commit 11548bc
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# -*- coding: utf-8; mode: sh; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=sh:et:sw=4:ts=4:sts=4 | ||
|
||
# Note: | ||
# This script is sourced by the mpbb wrapper script. | ||
# Do not execute this directly! | ||
|
||
port-commit-usage() { | ||
# "prog" is defined in mpbb-help. | ||
# shellcheck disable=SC2154 | ||
cat <<EOF | ||
usage: $prog [<global opts>] port-commit <port> | ||
Print the latest commit hash of the given port. | ||
Run \`$prog help' for global options and a list of other subcommands. | ||
EOF | ||
} | ||
|
||
port-commit() { | ||
local port=${1-} | ||
if [[ -z $port ]]; then | ||
err "Must specify a port" | ||
return 1 | ||
fi | ||
|
||
# $option_prefix is set in mpbb | ||
# shellcheck disable=SC2154 | ||
portdir=$("${option_prefix}/bin/port" dir "$port") || return | ||
git -C "$portdir" log -n 1 --pretty=format:%H . | ||
} |