Re: git --version

From: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Date: 2006-06-01 06:08:43
On 5/31/06, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> On 5/31/06, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> [...]
> > And even more intersting:
> > make clean && make && sudo make install
> > git --version
> > git version 1.3.GIT
> >
> > make install
> > [...]
> > mv git-cherry-pick+ git-cherry-pick
> > mv: sovrascrivo `git-cherry-pick' ignorando il modo 0755?
> > that in english is something like:
> > mv: overwrite `git-cherry-pick' ignoring mod 0755?
> >
> > Wow...of course, make clean && make install fix everything
> >
>
> Thanks to loops on #git for asking me to do the following test:
>
> <PaoloC> paolo@Italia:~/git$ sudo ./GIT-VERSION-GEN
> <PaoloC> GIT_VERSION = 1.3.GIT
> <PaoloC> paolo@Italia:~/git$ ./GIT-VERSION-GEN
> <PaoloC> GIT_VERSION = 1.3.3.g2186
>
> I don't know why it's happening...

Ok, thanks to the people living in #git!!

the problem is the following, from GIT-VERSION-GEN:
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=v1.3.GIT

# First try git-describe, then see if there is a version file
# (included in release tarballs), then default
if VN=$(git describe --abbrev=4 HEAD 2>/dev/null); then
        VN=$(echo "$VN" | sed -e 's/-/./g');
elif test -f version
then
        VN=$(cat version) || VN="$DEF_VER"
else
        VN="$DEF_VER"
fi

paolo@Italia:~/git$ git describe --abbrev=4 HEAD
v1.3.3-g2186

but...

paolo@Italia:~/git$ sudo git describe --abbrev=4 HEAD
sudo: git: command not found

that's because:
paolo@Italia:~/git$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/home/paolo/bin
but...
paolo@Italia:~/git$ sudo sh
sh-3.1# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

Don't know whay $PATH are different but at least why I know why git
has that strange behaviour.

Ciao,


-- 
Paolo
http://paolociarrocchi.googlepages.com
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Jun 01 06:09:29 2006

This archive was generated by hypermail 2.1.8 : 2006-06-01 06:10:35 EST