Skip to content

Instantly share code, notes, and snippets.

@C-Duv
Created April 1, 2021 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save C-Duv/231d21c91e8f1d244a6ef45736ce74ae to your computer and use it in GitHub Desktop.
Save C-Duv/231d21c91e8f1d244a6ef45736ce74ae to your computer and use it in GitHub Desktop.
Unexpand the "svn:id" SVN property ($Id$)
#!/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\$/'
@C-Duv
Copy link
Author

C-Duv commented Apr 1, 2021

Found this script in a 5 years old file of mine and figured I would share it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment