Created
April 1, 2021 13:32
-
-
Save C-Duv/231d21c91e8f1d244a6ef45736ce74ae to your computer and use it in GitHub Desktop.
Unexpand the "svn:id" SVN property ($Id$)
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
#!/bin/bash | |
# Unexpand the "svn:id" SVN property ($Id$) | |
# | |
# Anywhere the expanded "$Id$" string (eg. "$Id: Foobar.php 42 1970-01-01 00:00:00Z jdoe$") | |
# is found, it is replaced by "$Id". | |
# Usefull to quickly compare code file-by-file | |
DIR="$1" | |
grep \ | |
--recursive \ | |
--files-with-matches \ | |
--binary-files=without-match \ | |
'$Id:' "$DIR" \ | |
| xargs \ | |
sed \ | |
--regexp-extended \ | |
--in-place \ | |
's/\$Id: .*\$/\$Id\$/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found this script in a 5 years old file of mine and figured I would share it.