From 04c0f5bc914c4967bf4f74faf59d5eb6502a9b66 Mon Sep 17 00:00:00 2001 From: Alexander Scheipner Date: Thu, 2 May 2013 20:26:35 +0200 Subject: [PATCH] - added rcs-keywords - added empty check_lsi_raid --- .git_filters/rcs-keywords.clean | 13 +++++++++ .git_filters/rcs-keywords.smudge | 49 ++++++++++++++++++++++++++++++++ .gitattributes | 9 ++++++ check_lsi_raid | 27 ++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 .git_filters/rcs-keywords.clean create mode 100644 .git_filters/rcs-keywords.smudge create mode 100644 .gitattributes create mode 100644 check_lsi_raid diff --git a/.git_filters/rcs-keywords.clean b/.git_filters/rcs-keywords.clean new file mode 100644 index 0000000..175f972 --- /dev/null +++ b/.git_filters/rcs-keywords.clean @@ -0,0 +1,13 @@ +#!/usr/bin/perl -p +# +# @brief Git filter to implement rcs keyword expansion as seen in cvs and svn. +# @author Martin Turon +# +# Copyright (c) 2009-2011 Turon Technologies, Inc. All rights reserved. + +s/\$Id[^\$]*\$/\$Id\$/; +s/\$Date[^\$]*\$/\$Date\$/; +s/\$Author[^\$]*\$/\$Author\$/; +s/\$Source[^\$]*\$/\$Source\$/; +s/\$File[^\$]*\$/\$File\$/; +s/\$Revision[^\$]*\$/\$Revision\$/; diff --git a/.git_filters/rcs-keywords.smudge b/.git_filters/rcs-keywords.smudge new file mode 100644 index 0000000..e83c166 --- /dev/null +++ b/.git_filters/rcs-keywords.smudge @@ -0,0 +1,49 @@ +#!/usr/bin/perl +# +# @brief Git filter to implement rcs keyword expansion as seen in cvs and svn. +# @author Martin Turon +# +# Usage: +# .git_filter/rcs-keywords.smudge file_path < file_contents +# +# To add keyword expansion: +# /.gitattributes - *.c filter=rcs-keywords +# /.git_filters/rcs-keywords.smudge - copy this file to project +# /.git_filters/rcs-keywords.clean - copy companion to project +# ~/.gitconfig - add [filter] lines below +# +# [filter "rcs-keywords"] +# clean = .git_filters/rcs-keywords.clean +# smudge = .git_filters/rcs-keywords.smudge %f +# +# Copyright (c) 2009-2011 Turon Technologies, Inc. All rights reserved. + +$path = shift; +$path =~ /.*\/(.*)/; +$filename = $1; + +if (0 == length($filename)) { + $filename = $path; +} + +# Need to grab filename and to use git log for this to be accurate. +$rev = `git log -- $path | head -n 3`; +$rev =~ /^Author:\s*(.*)\s*$/m; +$author = $1; +$author =~ /\s*(.*)\s*<.*/; +$name = $1; +$rev =~ /^Date:\s*(.*)\s*$/m; +$date = $1; +$rev =~ /^commit (.*)$/m; +$ident = $1; + +while () { + s/\$Date[^\$]*\$/\$Date: $date \$/; + s/\$Author[^\$]*\$/\$Author: $author \$/; + s/\$Id[^\$]*\$/\$Id: $filename | $date | $name \$/; + s/\$File[^\$]*\$/\$File: $filename \$/; + s/\$Source[^\$]*\$/\$Source: $path \$/; + s/\$Revision[^\$]*\$/\$Revision: $ident \$/; +} continue { + print or die "-p destination: $!\n"; +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8f7910d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# .gitattributes +# Map file extensions to git filters + +*.h filter=rcs-keywords +*.c filter=rcs-keywords +*.cc filter=rcs-keywords +*.m filter=rcs-keywords +*.mm filter=rcs-keywords +check_lsi_raid filter=rcs-keywords diff --git a/check_lsi_raid b/check_lsi_raid new file mode 100644 index 0000000..b4883c1 --- /dev/null +++ b/check_lsi_raid @@ -0,0 +1,27 @@ +#!/usr/bin/perl -w +# ====================================================================================== +# file: check_lsi_raid $Revision$ $Date$ $Author$ +# $Id$ +# -------------------------------------------------------------------------------------- +# Created as part of a semester project at the University of Applied Sciences Hagenberg +# (http://www.fh-ooe.at/en/hagenberg-campus/) +# +# Copyright (c) 2013: +# Grubhofer Martin (s1110239013@students.fh-hagenberg.at) +# Scheipner Alexander (s1110239032@students.fh-hagenberg.at) +# Werner Sebastian (s1110239038@students.fh-hagenberg.at) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# ======================================================================================