diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fcommit | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/bin/fcommit b/bin/fcommit new file mode 100755 index 0000000..68835a9 --- /dev/null +++ b/bin/fcommit @@ -0,0 +1,64 @@ +#!/bin/sh +# kernel-check -- Gentoo Kernel Security +# Copyright 2009-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +TEXT=".*$@.*" +KNOWNCOMMITS="" +LASTFIXEDBRANCH="" +WHITEBOARD="" + +GOOD=$'\e[32;01m' +BAD=$'\e[31;01m' +BRACKET=$'\e[34;01m' +NORMAL=$'\e[0m' + +BRANCHES="`git branch -a | grep linux` origin/master" +for B in $BRANCHES ; do + COMMITS="`git rev-list --pretty=oneline "$B" | + grep "$TEXT" | cut -d " " -f 1`" + for C in $COMMITS ; do + if [ "${KNOWNCOMMITS/$C/}" == "$KNOWNCOMMITS" ] ; then + TAG="`git describe --contains --all "$C"`" + LABEL="${TAG/remotes\/origin\/linux-/v}" + LABEL="${LABEL/tags\//}" + + DESC="`git --no-pager log -1 --pretty=short "$C"`" + DESC="`echo "$DESC" | tr -s "\n" `" + DESC="${GOOD}label${NORMAL} ${LABEL}\n${DESC}" + + DESC="${DESC/commit/${GOOD}commit${NORMAL}}" + DESC="${DESC/Author:/${GOOD}author${NORMAL}}" + DESC="${DESC/ /${GOOD}title${NORMAL} ${BRACKET}}${NORMAL}\n" + echo -e "$DESC" + + VERSION="${TAG/tags\/v/}" + VERSION="${VERSION/~*/}" + VERSION="${VERSION/^*/}" + + if [ "$B" != "origin/master" ] ; then + THISBRANCH="${B/remotes\/origin\/linux-/}" + THISBRANCH="${THISBRANCH/.y/}" + REVISION="${THISBRANCH/*./}" + MAJORMINOR="${THISBRANCH/.${REVISION}/}" + let REVISION=REVISION+1 + NEXTBRANCH="${MAJORMINOR}.${REVISION}" + fi + if [ -z "$LASTFIXEDBRANCH" ] ; then + WHITEBOARD="$WHITEBOARD [linux <${VERSION}]" + else + if [ "${LASTFIXEDBRANCH}" == "${VERSION/-rc*/}" ] ; then + WHITEBOARD="${WHITEBOARD} ${BAD}[linux >= \ + ${LASTFIXEDBRANCH} <${VERSION}]${NORMAL}" + else + WHITEBOARD="${WHITEBOARD} [linux >= \ + ${LASTFIXEDBRANCH} <${VERSION}]" + fi + fi + LASTFIXEDBRANCH=$NEXTBRANCH + KNOWNCOMMITS="$KNOWNCOMMITS $C" + fi + done +done +echo -e "${GOOD}Whiteboard${NORMAL}\n${WHITEBOARD:1}\n" + |