ソースを参照

HADOOP-4181. Include a .gitignore and saveVersion.sh change to support
developing under git. (omalley)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@696104 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 16 年 前
コミット
f639d9f65f
3 ファイル変更42 行追加2 行削除
  1. 30 0
      .gitignore
  2. 3 0
      CHANGES.txt
  3. 9 2
      src/saveVersion.sh

+ 30 - 0
.gitignore

@@ -0,0 +1,30 @@
+# 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 regarding copyright ownership.
+# The ASF licenses this file 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.
+
+*~
+.classpath
+.project
+.settings
+build/
+conf/masters
+conf/slaves
+conf/hadoop-env.sh
+conf/hadoop-site.xml
+conf/capacity-scheduler.xml
+docs/api/
+logs/
+src/contrib/ec2/bin/hadoop-ec2-env.sh
+src/contrib/index/conf/index-config.xml
+src/docs/build

+ 3 - 0
CHANGES.txt

@@ -326,6 +326,9 @@ Trunk (unreleased changes)
     HADOOP-4174. Move fs image/edit log methods from ClientProtocol to
     NamenodeProtocol. (shv via szetszwo)
 
+    HADOOP-4181. Include a .gitignore and saveVersion.sh change to support
+    developing under git. (omalley)
+
   OPTIMIZATIONS
 
     HADOOP-3556. Removed lock contention in MD5Hash by changing the 

+ 9 - 2
src/saveVersion.sh

@@ -21,10 +21,17 @@
 unset LANG
 unset LC_CTYPE
 version=$1
-revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
-url=`svn info | sed -n -e 's/URL: \(.*\)/\1/p'`
 user=`whoami`
 date=`date`
+if [ -d .git ]; then
+  revision=`git log -1 --pretty=oneline`
+  hostname=`hostname`
+  branch=`git br | sed -n -e 's/^* //p'`
+  url="git://$hostname/$cwd on branch $branch"
+else
+  revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
+  url=`svn info | sed -n -e 's/URL: \(.*\)/\1/p'`
+fi
 mkdir -p build/src/org/apache/hadoop
 cat << EOF | \
   sed -e "s/VERSION/$version/" -e "s/USER/$user/" -e "s/DATE/$date/" \