Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba3d05fb6369e617aee4f16bfce7ba5cbd30f26b
Commit:     ba3d05fb6369e617aee4f16bfce7ba5cbd30f26b
Parent:     fa95eb1f17a5fe7b3593cff4bf27dbe9ae6cac89
Author:     Bryan Wu <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 3 14:13:26 2008 +0800
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Sun Feb 3 08:59:50 2008 +0100

    kbuild: add svn revision information to setlocalversion
    
    follow git and mercurial style, include uncommitted changes detect
    
    Cc: Frans Pop <[EMAIL PROTECTED]>
    Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
 scripts/setlocalversion |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
old mode 100644
new mode 100755
index 52f032e..1c1bdaf
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -45,3 +45,19 @@ if hgid=`hg id 2>/dev/null`; then
        # All done with mercurial
        exit
 fi
+
+# Check for svn and a svn repo.
+if rev=`svn info 2>/dev/null | grep '^Revision'`; then
+       rev=`echo $rev | awk '{print $NF}'`
+       changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l`
+
+       # Are there uncommitted changes?
+       if [ $changes != 0 ]; then
+               printf -- '-svn%s%s%s' "$rev" -dirty "$changes"
+       else
+               printf -- '-svn%s' "$rev"
+       fi
+
+       # All done with svn
+       exit
+fi
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to