Re: git --version

16 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: git --version

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:28

"Paolo Ciarrocchi" [off-list ref] writes:
paolo@Italia:~$ cd git/
paolo@Italia:~/git$ git --version
git version 1.3.GIT
paolo@Italia:~/git$ make >/dev/null
paolo@Italia:~/git$ sudo make install >/dev/null
Password:
GIT_VERSION = 1.3.GIT
Unfortunate is we cannot see what this "sudo" did -- does it
successfully run (installed) git to check the "full" version and
manage to store it in ./GIT-VERSION-FILE?

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Junio C Hamano [off-list ref] wrote:
"Paolo Ciarrocchi" [off-list ref] writes:
quoted
paolo@Italia:~$ cd git/
paolo@Italia:~/git$ git --version
git version 1.3.GIT
paolo@Italia:~/git$ make >/dev/null
paolo@Italia:~/git$ sudo make install >/dev/null
Password:
GIT_VERSION = 1.3.GIT
Unfortunate is we cannot see what this "sudo" did -- does it
successfully run (installed) git to check the "full" version and
manage to store it in ./GIT-VERSION-FILE?
Just the few last lines:

install git-checkout-index git-clone-pack git-convert-objects
git-fetch-pack git-fsck-objects git-hash-object git-index-pack
git-local-fetch git-mailinfo git-merge-base git-merge-index git-mktag
git-mktree git-pack-objects git-patch-id git-peek-remote
git-prune-packed git-receive-pack git-rev-parse git-send-pack
git-shell git-show-index git-ssh-fetch git-ssh-upload git-unpack-file
git-unpack-objects git-update-index git-update-server-info
git-upload-pack git-verify-pack git-write-tree git-update-ref
git-symbolic-ref git-name-rev git-pack-redundant git-repo-config
git-var git-describe git-merge-tree git-blame git-imap-send
git-ssh-pull git-ssh-push git-http-fetch git-http-push
git-get-tar-commit-id git-mailsplit git-stripspace git-daemon
git-bisect git-branch git-checkout git-cherry git-clean git-clone
git-commit git-fetch git-ls-remote git-merge-one-file git-parse-remote
git-prune git-pull git-rebase git-repack git-request-pull git-reset
git-resolve git-revert git-sh-setup git-tag git-verify-tag
git-applymbox git-applypatch git-am git-merge git-merge-stupid
git-merge-octopus git-merge-resolve git-merge-ours git-lost-found
git-quiltimport git-archimport git-cvsimport git-relink git-shortlog
git-fmt-merge-msg git-rerere git-annotate git-cvsserver git-svnimport
git-mv git-cvsexportcommit git-send-email git-merge-recursive
git-cherry-pick git-status '/home/paolo/bin'
install git gitk '/home/paolo/bin'
make -C templates install
make[1]: Entering directory `/home/paolo/git/templates'
: no custom templates yet
install -d -m755 '/home/paolo/share/git-core/templates/'
(cd blt && tar cf - .) | \
        (cd '/home/paolo/share/git-core/templates/' && tar xf -)
make[1]: Leaving directory `/home/paolo/git/templates'
install -d -m755 '/home/paolo/share/git-core/python'
install gitMergeCommon.py '/home/paolo/share/git-core/python'
if test 'z/home/paolo/bin' != 'z/home/paolo/bin'; \
        then \
                ln -f '/home/paolo/bin/git' \
                        '/home/paolo/bin/git' || \
                cp '/home/paolo/bin/git' \
                        '/home/paolo/bin/git'; \
        fi
rm -f '/home/paolo/bin/git-log' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-log' ;  rm -f '/home/paolo/bin/git-whatchanged'
&& ln '/home/paolo/bin/git' '/home/paolo/bin/git-whatchanged' ;  rm -f
'/home/paolo/bin/git-show' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-show' ;  rm -f
'/home/paolo/bin/git-count-objects' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-count-objects' ;  rm -f
'/home/paolo/bin/git-diff' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-diff' ;  rm -f '/home/paolo/bin/git-push' && ln
'/home/paolo/bin/git' '/home/paolo/bin/git-push' ;  rm -f
'/home/paolo/bin/git-grep' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-grep' ;  rm -f '/home/paolo/bin/git-add' && ln
'/home/paolo/bin/git' '/home/paolo/bin/git-add' ;  rm -f
'/home/paolo/bin/git-rm' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-rm' ;  rm -f '/home/paolo/bin/git-rev-list' && ln
'/home/paolo/bin/git' '/home/paolo/bin/git-rev-list' ; rm -f
'/home/paolo/bin/git-check-ref-format' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-check-ref-format' ;  rm -f
'/home/paolo/bin/git-init-db' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-init-db' ;  rm -f '/home/paolo/bin/git-tar-tree'
&& ln '/home/paolo/bin/git' '/home/paolo/bin/git-tar-tree' ;  rm -f
'/home/paolo/bin/git-upload-tar' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-upload-tar' ;  rm -f
'/home/paolo/bin/git-format-patch' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-format-patch' ;  rm -f
'/home/paolo/bin/git-ls-files' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-ls-files' ;  rm -f '/home/paolo/bin/git-ls-tree'
&& ln '/home/paolo/bin/git' '/home/paolo/bin/git-ls-tree' ;  rm -f
'/home/paolo/bin/git-read-tree' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-read-tree' ;  rm -f
'/home/paolo/bin/git-commit-tree' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-commit-tree' ;  rm -f '/home/paolo/bin/git-apply'
&& ln '/home/paolo/bin/git' '/home/paolo/bin/git-apply' ;  rm -f
'/home/paolo/bin/git-show-branch' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-show-branch' ;  rm -f
'/home/paolo/bin/git-diff-files' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-diff-files' ;  rm -f
'/home/paolo/bin/git-diff-index' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-diff-index' ;  rm -f
'/home/paolo/bin/git-diff-stages' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-diff-stages' ;  rm -f
'/home/paolo/bin/git-diff-tree' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-diff-tree' ;  rm -f
'/home/paolo/bin/git-cat-file' && ln '/home/paolo/bin/git'
'/home/paolo/bin/git-cat-file' ;
paolo@Italia:~/git$ git --version

So yes, it's correctly installed (I pull, compile and install almost
daily always without any problem).

Ciao and thanks!

-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Paolo Ciarrocchi [off-list ref] wrote:
 > So yes, it's correctly installed (I pull, compile and install almost
daily always without any problem).
Tried with:
 make clean
 make && sudo make install
 [...]
 paolo@Italia:~/git$ git --version
 git version 1.3.GIT
 paolo@Italia:~/git$ ./GIT-VERSION-GEN
 GIT_VERSION = 1.3.3.g2186

Puzzled.


-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:28


On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
[...]
install git gitk '/home/paolo/bin'
Why are you doing a "sudo" when you install in your own ~/bin (the default 
for git).

The whole point of installing in ~/bin is to not need any elevated 
priorities.

I get the feeling that you might have installed something in /usr/bin/ or 
/usr/local/bin earlier, and that they are before ~/bin in your PATH.

		Linus

Re: git --version

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:28


On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
Tried with:
make clean
make && sudo make install
[...]
paolo@Italia:~/git$ git --version
git version 1.3.GIT
paolo@Italia:~/git$ ./GIT-VERSION-GEN
GIT_VERSION = 1.3.3.g2186
What does

	git describe
	./git --version
	which git

say?

		Linus

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Linus Torvalds [off-list ref] wrote:

On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
quoted
[...]
install git gitk '/home/paolo/bin'
Why are you doing a "sudo" when you install in your own ~/bin (the default
for git).
Good question :-)
Just because I'm used to do that but you are absolutelly right saying
that is wrong.
The whole point of installing in ~/bin is to not need any elevated
priorities.

I get the feeling that you might have installed something in /usr/bin/ or
/usr/local/bin earlier, and that they are before ~/bin in your PATH.
I don't think so since:
paolo@Italia:~/git$ which git
/home/paolo/bin/git

But I'll do a make && make install in a minute.

Thanks!

Ciao,
-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Linus Torvalds [off-list ref] wrote:

On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
quoted
Tried with:
make clean
make && sudo make install
[...]
paolo@Italia:~/git$ git --version
git version 1.3.GIT
paolo@Italia:~/git$ ./GIT-VERSION-GEN
GIT_VERSION = 1.3.3.g2186
What does

        git describe
paolo@Italia:~/git$ git describe
v1.3.3-g2186d56
        ./git --version
paolo@Italia:~/git$ ./git --version
git version 1.3.3.g2186

Doh..
        which git
paolo@Italia:~/git$ which git
/home/paolo/bin/git

Ciao,
-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Paolo Ciarrocchi [off-list ref] wrote:
On 5/31/06, Linus Torvalds [off-list ref] wrote:
quoted

On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
quoted
Tried with:
make clean
make && sudo make install
[...]
paolo@Italia:~/git$ git --version
git version 1.3.GIT
paolo@Italia:~/git$ ./GIT-VERSION-GEN
GIT_VERSION = 1.3.3.g2186
What does

        git describe
paolo@Italia:~/git$ git describe
v1.3.3-g2186d56
quoted
        ./git --version
paolo@Italia:~/git$ ./git --version
git version 1.3.3.g2186

Doh..
quoted
        which git
paolo@Italia:~/git$ which git
/home/paolo/bin/git
Ok...
make && make install

Now I get:
paolo@Italia:~$ git --version
git version 1.3.3.g2186

That is correct.

But I'm still wondering why doing sudo make install caused that
problem, git was correcly installed in /home/paolo/git

Really puzzled.

Ciao,

-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:28


On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
quoted
        git describe
paolo@Italia:~/git$ git describe
v1.3.3-g2186d56
Ok.
quoted
        ./git --version
paolo@Italia:~/git$ ./git --version
git version 1.3.3.g2186

Doh..
Ok, that's also good.
quoted
        which git
paolo@Italia:~/git$ which git
/home/paolo/bin/git
I think I know what's up.

Your "sudo" made "$HOME" be /root. So by doing "sudo make install", you 
installed the git in _roots_ ~/bin, ie /root/bin/.

			Linus

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Linus Torvalds [off-list ref] wrote:
On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
quoted
quoted
        git describe
paolo@Italia:~/git$ git describe
v1.3.3-g2186d56
Ok.
quoted
quoted
        ./git --version
paolo@Italia:~/git$ ./git --version
git version 1.3.3.g2186

Doh..
Ok, that's also good.
quoted
quoted
        which git
paolo@Italia:~/git$ which git
/home/paolo/bin/git
I think I know what's up.

Your "sudo" made "$HOME" be /root. So by doing "sudo make install", you
installed the git in _roots_ ~/bin, ie /root/bin/.
Doh... not sure to follow you, just did:
sudo make install
paolo@Italia:~/git$ ls /root/
paolo@Italia:~/git$ git --version
git version 1.3.GIT



-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Paolo Ciarrocchi [off-list ref] wrote:
On 5/31/06, Linus Torvalds [off-list ref] wrote:
quoted
On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
quoted
quoted
        git describe
paolo@Italia:~/git$ git describe
v1.3.3-g2186d56
Ok.
quoted
quoted
        ./git --version
paolo@Italia:~/git$ ./git --version
git version 1.3.3.g2186

Doh..
Ok, that's also good.
quoted
quoted
        which git
paolo@Italia:~/git$ which git
/home/paolo/bin/git
I think I know what's up.

Your "sudo" made "$HOME" be /root. So by doing "sudo make install", you
installed the git in _roots_ ~/bin, ie /root/bin/.
Doh... not sure to follow you, just did:
sudo make install
paolo@Italia:~/git$ ls /root/
paolo@Italia:~/git$ git --version
git version 1.3.GIT
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

Ciao,

-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Paolo Ciarrocchi [off-list ref] 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...
-- 
Paolo
http://paolociarrocchi.googlepages.com

Re: git --version

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:28


On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
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...
Heh. You don't have git in your PATH as root. So as root you don't know 
what version of git you have ;)

		Linus

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Paolo Ciarrocchi [off-list ref] wrote:
On 5/31/06, Paolo Ciarrocchi [off-list ref] wrote:
[...]
quoted
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

Re: git --version

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:28


On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
Don't know whay $PATH are different
See ENVIRONMENT in the sudo man-page:

        PATH                   Set to a sane value if sudo was configured with
                               the --with-secure-path option

so apparently your distro builds sudo with "--with-secure-path".

		Linus

Re: git --version

From: Paolo Ciarrocchi <hidden>
Date: 2016-06-15 22:42:28

On 5/31/06, Linus Torvalds [off-list ref] wrote:

On Wed, 31 May 2006, Paolo Ciarrocchi wrote:
quoted
Don't know whay $PATH are different
See ENVIRONMENT in the sudo man-page:

        PATH                   Set to a sane value if sudo was configured with
                               the --with-secure-path option

so apparently your distro builds sudo with "--with-secure-path".
Yup, you must be correct. Thanks.

My distro is Ubuntu Dapper.

Ciao,

-- 
Paolo
http://paolociarrocchi.googlepages.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help