Skip to content

Commit

Permalink
- Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
cwalter-at committed Sep 13, 2018
0 parents commit b199fa9
Show file tree
Hide file tree
Showing 1,106 changed files with 292,548 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .git_filters/rcs-keywords.clean
Original file line number Diff line number Diff line change
@@ -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\$/;
49 changes: 49 additions & 0 deletions .git_filters/rcs-keywords.smudge
Original file line number Diff line number Diff line change
@@ -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:
# <project>/.gitattributes - *.c filter=rcs-keywords
# <project>/.git_filters/rcs-keywords.smudge - copy this file to project
# <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 (<STDIN>) {
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";
}
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# .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
Loading

0 comments on commit b199fa9

Please sign in to comment.