openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msei...@apache.org
Subject [openoffice] branch trunk updated: Set length of short git hash to 10
Date Tue, 10 Sep 2019 21:37:47 GMT
This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 9b02d67  Set length of short git hash to 10
9b02d67 is described below

commit 9b02d6736f880ca4d77732ed1dcb2275da3f1f67
Author: mseidel <mseidel@apache.org>
AuthorDate: Tue Sep 10 23:37:12 2019 +0200

    Set length of short git hash to 10
---
 main/solenv/bin/modules/SvnRevision.pm | 84 +++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 41 deletions(-)

diff --git a/main/solenv/bin/modules/SvnRevision.pm b/main/solenv/bin/modules/SvnRevision.pm
index eab9538..81b811e 100644
--- a/main/solenv/bin/modules/SvnRevision.pm
+++ b/main/solenv/bin/modules/SvnRevision.pm
@@ -1,5 +1,5 @@
 #**************************************************************
-#  
+#
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -7,69 +7,71 @@
 #  to you under the Apache License, Version 2.0 (the
 #  "License"); you may not use this file except in compliance
 #  with the License.  You may obtain a copy of the License at
-#  
+#
 #    http://www.apache.org/licenses/LICENSE-2.0
-#  
+#
 #  Unless required by applicable law or agreed to in writing,
 #  software distributed under the License is distributed on an
 #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 #  KIND, either express or implied.  See the License for the
 #  specific language governing permissions and limitations
 #  under the License.
-#  
+#
 #**************************************************************
 
+
+
 package SvnRevision;
 
 #old SVN code unchanged
 sub DetectRevisionIdFromSVN ($)
 {
-    my $path = shift;
+	my $path = shift;
+
+	my $id = undef;
 
-    my $id = undef;
-    
-    open my $proc, "cd $path && svn info 2>\&1 |";
-    while (<$proc>)
-    {
-        if (/svn: E155007:/ || /svn: '.' is not a working copy/)
-        {
-            # Not in an SVN repository.
-            $id = DetectRevisionIdFromGit($path);
-            last;
-        }
-        else
-        {
-            if (/Last Changed Rev:\s+([0-9]+)/)
-            {
-                $id = $1;
-                last;
-            }
-        }
-    }
-    close $proc;
+	open my $proc, "cd $path && svn info 2>\&1 |";
+	while (<$proc>)
+	{
+		if (/svn: E155007:/ || /svn: '.' is not a working copy/)
+		{
+			# Not in an SVN repository.
+			$id = DetectRevisionIdFromGit($path);
+			last;
+		}
+		else
+		{
+			if (/Last Changed Rev:\s+([0-9]+)/)
+			{
+				$id = $1;
+				last;
+			}
+		}
+	}
+	close $proc;
 
-    return $id;
+	return $id;
 }
 
 
 sub DetectRevisionId ($)
 {
-    my $path = shift;
+	my $path = shift;
 
-    my $id = undef;
-    #test if path points to a git repository. if true return is 0 else positive number.
-    my $isNotGit= `[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1`;
-    if ($isNotGit)
-    {
-    	$id = DetectRevisionIdFromSVN ($path);
-    }
-    else
-    {
-    	#returns directly the hash of the current checkout.
-    	$id = `git log -1 --pretty=format:%h`;
-    }
+	my $id = undef;
+	#test if path points to a git repository. if true return is 0 else positive number.
+	my $isNotGit= `[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1`;
+	if ($isNotGit)
+	{
+		$id = DetectRevisionIdFromSVN ($path);
+	}
+	else
+	{
+		#returns directly the hash of the current checkout.
+		$id = `git log -1 --pretty=format:%h --abbrev=10`;
+	}
 
-    return $id;
+	return $id;
 }
 
 1;


Mime
View raw message