-
Notifications
You must be signed in to change notification settings - Fork 418
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
0 parents
commit b199fa9
Showing
1,106 changed files
with
292,548 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,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\$/; |
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,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"; | ||
} |
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,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 |
Oops, something went wrong.