[U-Boot] newbie question about patch to fix 'fatal: cannot describe'

Rainer Keller rkeller at ubicom.com
Tue Jun 16 01:00:56 CEST 2009


Hi All, 

This is my first posting to the list and I just joined the mailing list 
about a week ago. Plus I am pretty new to the open source world as well, 
so please send me pointers to where to look things up if the posting is 
not inappropriate or does not belong here. 

Any time I build U-Boot from my git checkout I receive the 'fatal: 
cannot describe' message. Googling quickly got me to the solution: A fix 
for similar behaviour in the kernel was fixed a while ago, basically it 
is a problem in setlocalversion. So I took the two relevant patches 
(instead of the full file because it looks like u-boot has it's own 
version of that file) and applied them to my repository. 

This is my patch: 

commit ec6609f492e41594715c4764ae7c0994e9e70270
Author: Rainer Keller <rkeller at ubicom.com>
Date:   Mon Jun 15 12:55:50 2009 -0700

    combined two kernel patches to fix git describe errors in tools/setlocalversion: Commit f03b283f081f538ec71b9e87cb8411bb62e2abc9 and Commit 56b2f0706d82535fd8d85503f2dcc0be40c8e55d

diff --git a/tools/setlocalversion b/tools/setlocalversion
index b3f5f28..aca9d63 100755
--- a/tools/setlocalversion
+++ b/tools/setlocalversion
@@ -9,11 +9,15 @@ usage() {
 cd "${1:-.}" || usage
 
 # Check for git and a git repo.
-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
 	# Do we have an untagged version?
 	if git name-rev --tags HEAD | \
 	   grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
-	        git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+		if tag=`git describe 2>/dev/null`; then
+			echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+		else
+			printf '%s%s' -g $head
+		fi
 	fi
 
 	# Are there uncommitted changes?

So here are my questions:

Obviously that is not my code, do I still add my `Signed-off-by'? 

Should I add the comments from the original commits to the kernel or it 
is ok to just refer to the commits? 

I don't have a publicly accessible git repository to ask a custodian to 
pull from and from checking the custodian list it looks like this is 
Wolfgang's area. Is it ok to just post it as is and expect him to apply 
it out of the email? 

If these seem to be slighly overly careful questions please consider 
that over time Ubicom would like to add a complete additional 
architecture with dozens of boards and we'll have a lot more newbie 
questions, so I want to start as polite as I can :) 

Best Regards,
Rainer Keller




More information about the U-Boot mailing list