One can add this property automatically when creating new files with the help of SVN's auto props feature. But from time to time someone, e.g. a new developer not knowing about auto props, checks in files without having the "svn:keywords" property set.
So I wondered how to identify such files in the repository. SVN doesn't provide a command answering that question, you only can retrieve all files having a certain property set.
But no problem, some shell magic to the rescue:
1 | comm -23 <(sort <(sed 's/\.\///g' <(find . -name "*.java"))) <(sort <(sed 's/ - Id//g' <(svn propget svn:keywords * -R))) |
So what's happening here? The basic idea is to list those files with the svn:keywords property set (
svn propget
) and compare this to a list with all files (find
).The outputs of both commands are brought into the same format using
sed
, sorted and then passed as parameters to the comm
command, which compares two input files to each other. The -23
parameter causes only those lines to be put out which are only contained in file1 but not in file2, which are exactly the names of those files lacking the "svn:keywords" property.I tested the command successfully on Mac OS X, but I think it should work pretty much the same way on other Unix systems, too.
49 comments:
Exactly what I needed. Thanks.
Great that I could be of help. Thanks for your feedback, Gunnar
Nice, exactly what i was looking for.
Since i do not use the Id Tag, I use this more generic variant (.* instead of Id):
comm -23 <(sort <(sed 's/\.\///g' <(find . -name "*.java"))) <(sort <(sed 's/ - .*//g' <(svn propget svn:keywords * -R)))
> from time to time someone, e.g. a new developer not knowing about auto props, checks in files without having the "svn:keywords" property set.
Or, you know, an experienced developer who realizes that version control information belongs in the version control system and not in the source code...
Found this blog post helpful while looking for information on how to nuke these useless keywords from my code:
svn propdel svn:keywords . --recursive
Thank you for this tip.. Exactly what I needed.
The value of the keywords properties is in the eye of the beholder. It is there for a single reason: it is useful for a large group of users.
Some developers love to type commands to find information that can be just read by looking at the top of the file, and it requires no effort to be updated.
I run this in a single find. For example, the following finds Java files which do not have svn:eol-style=native:
#!/bin/sh
find . -name "*.java" -print |
(while read javaFile
do
eolStyle=`svn propget svn:eol-style $javaFile`
if [ "$eolStyle" != "native" ]; then
echo $javaFile ":" $eolStyle
fi
done
)
Never gonna give up
Cara Menyembuhkan otitis Media (Radang Telinga Tengah) Secara Alami
Great article on our site. Keep up the good writing.
Obat Herbal Gula Darah Tinggi Terbaik
Obat Benjolan Di Bibir Vagina
Cara Mengobati Luka Bakar
Obat Menghilangkan flek hitam ekas jerawat
Obat Mengatasi Telat Datang Haid
Obat perut keras dan kembung
Obat Menghilangkan Benjolan Lipoma
Obat prurigo secara alami
Obat farry liver
Obat impetigo pada anak
Obat penyakit liver
Obat Asam Lambung Naik
Obat Gatal di Sekitar Kemaluan
http://hargajellygamat.net/cara-mengobati-gatal-di-sekitar-kemaluan-dan-selangkangan/
cara mengobati telinga berair
Obat Cantegan Bodo Isi
Obat Cacingan
Salep Penghilang Bekas Jerawat,Salep penghilang bekas jerawat
salep untuk cacar air
salep mata ikan
http://www.kebunmanggis.web.id/cara-mengobati-penyakit-kuning/
Cara Mengobati Penyakit Kuning
Obat Penghilang Bekas Luka Bakar Obat Penghilang Bekas Luka Bakar
Obat penghilang benjolan d pergelangan tangan
obat jamur kuku djempol kaki
Cara Menghilangkan Jamur di Selangkangan
obat telinga berdengung sebelah
Cara Menghilangkan Bekas Cacar Air Di Wajah Dengan Cepat
Hemangioma Pada Bayi
Obat gatal di selangkangan
obat untuk menghilangkan bekas luka yang menghitam
cara menghilangkan balas bogo
cara merawat kuku kaki yang rusak
Obat Penurun Kolesterol Dalam 5 Hari
Nama Obat Batuk Berdahak
Vitamin yang Bagus Untuk Daya Tahan Tubuh
cara merawat wajah biar awet muda
obat Pembersih Jerawat
cara mengobati kutu air di jari tangan
Cara Menghilangkan Bekas Luka Knalpot
Cara mengoabati alergi kulit bentol
Manfaat Daun Mengkudu Untuk Melangsingkan Tubuhobat jantung bengkak ace maxs
Your publications are always inspiring.
Brunette ladies
Great and useful article. Creating content regularly is very tough. Thanks you.
Thank you for this post. This is very interesting information for me.
Thanks for this information, I think it will come in handy in the future.
Very nice blog, Thanks for sharing a great article.
You are providing wonderful information, it is very useful to us.
Keep posting like these informative articles.
Thank you.
From: Field Engineer
For more information about: Cloud Architect
From creating the most technical and bespoke academic assignments on demand to securing the most excellent academic grades, Great Assignment Helper furnishes the best Economics assignment help to students at the cheapest rates.
يعد سهم الطيار من افضل الاسهم حالياً في سوق الاسهم السعودي
Post a Comment