[Mono-dev] [PATCH] Version fix for git

Andreas Färber andreas.faerber at web.de
Sat Mar 20 17:54:06 EDT 2010


Hello,

When working on a Git repository that was cloned from a git-svn repo,  
it is currently displayed as "tarball" in `mono -V`.

The method used to obtain the git revision info - searching the log -  
is independent of git-svn.
The patch below thus only checks for a .git subdirectory. Any  
objections?

Regards,
Andreas

diff --git a/mono/mini/Makefile.am b/mono/mini/Makefile.am
index 4fe7052..093077b 100644
--- a/mono/mini/Makefile.am
+++ b/mono/mini/Makefile.am
@@ -586,7 +586,7 @@ EXTRA_DIST = $(common_BURGSRC) TestDriver.cs  
ldscript ldscript.mono \
  	$(posix_sources)

  version.h: Makefile
-	if test -d $(top_srcdir)/.git/svn; then svn_info="git log --no-color  
--first-parent -n1 --grep=git-svn-id: --pretty=format:%b | sed -n -e  
's,git-svn-id: \(.*\)@\(.*\) .*,URL: \1 Revision: \2,p'"; fi; \
+	if test -d $(top_srcdir)/.git; then svn_info="git log --no-color -- 
first-parent -n1 --grep=git-svn-id: --pretty=format:%b | sed -n -e  
's,git-svn-id: \(.*\)@\(.*\) .*,URL: \1 Revision: \2,p'"; fi; \
  	if test -d $(srcdir)/.svn; then svn_info='svn info'; fi; \
  	if test -n "$$svn_info"; then \
  		(cd $(top_srcdir); \

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gitsvnrevision.diff
Type: application/octet-stream
Size: 800 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100320/adc2a438/attachment-0001.obj 
-------------- next part --------------



More information about the Mono-devel-list mailing list