Re: [git-users] Compiling Git on Linux..

2013-02-04 Thread Philip Oakley

From: "Konstantin Khomoutov" 
Sent: Monday, February 04, 2013 9:47 AM

On Mon, 04 Feb 2013 07:42:26 +
Philip Oakley  wrote:

[...]

Hi, yes, I was really wanting to hack on the latest version. I've
done a bit on the Msysgit version before, but to get at the Git core
code it looks like working on Linux would be the best approach. So
I'm trying to jump across the Windows -> Linux chasm now that I've go
a second hand laptop (my son needed a new one for completing his
engineering degree, so I repaired it and installed Ubuntu).

At the moment I'd got the compile OK, the path OK, with 'which -a
git' reporting the two versions (1.7.9.5 and 1.8.1.2.459), but 'git
--version' reported the older one.

I just rechecked this morning and see that the shutdown/reboot has
sorted out the execution priority, but I'm not sure why !


I think of two reasons for this:

1) You did mess with the PATH environment variable in your ~/.profile
  or ~/.bashrc or something like this, putting the "bin" directory of
  your Git installation there.  When you log in to the system, the
  first process to be run with your credentials in your login shell
  which reads its startup files and sets the environment inherited
  by all the child processes (unless explicitly overridden for some
  of them).  So mere tweaking of your shell startup files affects
  only the new shells you spawn (if you tweaked ~/.${shell}rc)
  or the shell being run when logging in (if you tweaked ~/.profile).


I'd avoided tweaking the path, and just checked it was as suggested with 
/usr/local/ first




2) Shells typically cache locations of programs which they look up in
  the directories specified in the PATH environment variable.  This
  presents a considerable speed boost, but this comes at a price: if a
  program which has been looked up (and cached) already changes its
  location or is ablout to be "shadowed" by another instance (your
  case, I reckon), the shell remains unaware about this.

  To "fix" this, you usually has to run `hash -r` [1] in your shell
  which makes it purge the cache, and so the next attempt to run a
  program will find it in its new place.


This certainly appears to be the case. I'll know to try the `hash -r` 
command, or close and re-open the terminal window.


Many thanks for the clarifications.



In other words, next time you face an issue like this, first try to
purge the program lookup cache in your shell and see if this helps.
If it doesn't, try running another shell (possibly with the "-l" (ell)
command-line option to make it behave as a login shell) and see if 
this

helps.  If it does, then logging out and in again will fix the
environment for the session.  Rebooting is only needed in rare cases
like a security update of the kernel package.

1. http://pubs.opengroup.org/onlinepubs/009695399/utilities/hash.html


--
Philip 


--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-04 Thread Konstantin Khomoutov
On Mon, 04 Feb 2013 07:42:26 +
Philip Oakley  wrote:

[...]
> Hi, yes, I was really wanting to hack on the latest version. I've
> done a bit on the Msysgit version before, but to get at the Git core
> code it looks like working on Linux would be the best approach. So
> I'm trying to jump across the Windows -> Linux chasm now that I've go
> a second hand laptop (my son needed a new one for completing his
> engineering degree, so I repaired it and installed Ubuntu).
> 
> At the moment I'd got the compile OK, the path OK, with 'which -a
> git' reporting the two versions (1.7.9.5 and 1.8.1.2.459), but 'git 
> --version' reported the older one.
> 
> I just rechecked this morning and see that the shutdown/reboot has 
> sorted out the execution priority, but I'm not sure why !

I think of two reasons for this:

1) You did mess with the PATH environment variable in your ~/.profile
   or ~/.bashrc or something like this, putting the "bin" directory of
   your Git installation there.  When you log in to the system, the
   first process to be run with your credentials in your login shell
   which reads its startup files and sets the environment inherited
   by all the child processes (unless explicitly overridden for some
   of them).  So mere tweaking of your shell startup files affects
   only the new shells you spawn (if you tweaked ~/.${shell}rc)
   or the shell being run when logging in (if you tweaked ~/.profile).

2) Shells typically cache locations of programs which they look up in
   the directories specified in the PATH environment variable.  This
   presents a considerable speed boost, but this comes at a price: if a
   program which has been looked up (and cached) already changes its
   location or is ablout to be "shadowed" by another instance (your
   case, I reckon), the shell remains unaware about this.

   To "fix" this, you usually has to run `hash -r` [1] in your shell
   which makes it purge the cache, and so the next attempt to run a
   program will find it in its new place.

In other words, next time you face an issue like this, first try to
purge the program lookup cache in your shell and see if this helps.
If it doesn't, try running another shell (possibly with the "-l" (ell)
command-line option to make it behave as a login shell) and see if this
helps.  If it does, then logging out and in again will fix the
environment for the session.  Rebooting is only needed in rare cases
like a security update of the kernel package.

1. http://pubs.opengroup.org/onlinepubs/009695399/utilities/hash.html

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread Philip Oakley

On 03/02/13 23:43, Konstantin Khomoutov wrote:

On Sun, Feb 03, 2013 at 05:34:00PM +, Philip Oakley wrote:


I have recently got a spare laptop and installed Linux (I've been on
Windows since 3.1, and stuff before that) , and I'm trying to get my
head around some of the Git install issues on Linux. In particular
how to compile my own version of Git, separate from the installed
version.

I've got Ubuntu
Description:Ubuntu 12.04.2 LTS
Release:12.04
Codename:   precise


[...]

Unless you *really* need the latest (i.e. tip of the "master") Git,
the best bet is to either stick with what's provided by the OS
or install a more fresh (usually the latest upstream release) using the
so-called backports.  This has been discussed here recently,
please see [1].


Hi, yes, I was really wanting to hack on the latest version. I've done a 
bit on the Msysgit version before, but to get at the Git core code it 
looks like working on Linux would be the best approach. So I'm trying to 
jump across the Windows -> Linux chasm now that I've go a second hand 
laptop (my son needed a new one for completing his engineering degree, 
so I repaired it and installed Ubuntu).


At the moment I'd got the compile OK, the path OK, with 'which -a git' 
reporting the two versions (1.7.9.5 and 1.8.1.2.459), but 'git 
--version' reported the older one.


I just rechecked this morning and see that the shutdown/reboot has 
sorted out the execution priority, but I'm not sure why !


Work beckons.



Also, as you've probably inferred from the thread, if you want both the
"stock" installation of Git (provided by the OS) to coexist with your
manually-built version, it's best to configure the build in such a way
that `make install` installs everything under a single directory
(typically under your home directory) -- this eases maintenance as you
later can just `rm -rf` it.

1. http://www.mail-archive.com/git-users@googlegroups.com/msg04131.html



--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread Konstantin Khomoutov
On Sun, Feb 03, 2013 at 05:34:00PM +, Philip Oakley wrote:

> I have recently got a spare laptop and installed Linux (I've been on
> Windows since 3.1, and stuff before that) , and I'm trying to get my
> head around some of the Git install issues on Linux. In particular
> how to compile my own version of Git, separate from the installed
> version.
> 
> I've got Ubuntu
> Description:  Ubuntu 12.04.2 LTS
> Release:  12.04
> Codename: precise

[...]

Unless you *really* need the latest (i.e. tip of the "master") Git,
the best bet is to either stick with what's provided by the OS
or install a more fresh (usually the latest upstream release) using the
so-called backports.  This has been discussed here recently, 
please see [1].

Also, as you've probably inferred from the thread, if you want both the
"stock" installation of Git (provided by the OS) to coexist with your
manually-built version, it's best to configure the build in such a way
that `make install` installs everything under a single directory
(typically under your home directory) -- this eases maintenance as you
later can just `rm -rf` it.

1. http://www.mail-archive.com/git-users@googlegroups.com/msg04131.html

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread Philip Oakley
My missing step was the next step listed on the web page 

'sudo make prefix=/usr/local all'

This then did the business of populating the /usr/local/bin directory. Not 
really sure what extradifference it makes... 

- Original Message - 
  From: Philip Oakley 
  To: git-users@googlegroups.com ; John McKown 
  Sent: Sunday, February 03, 2013 8:26 PM
  Subject: Re: [git-users] Compiling Git on Linux..


  That was a useful start, I also realised I hadn't made sure I'd checked out 
the right working tree (my repo has both the Msysgit version and Junio's 
versio). The /usr/local/bin directory was empty, but at least I've now got a 
clue as to where to start looking, and I've now checked may path is set up ;-) .
- Original Message - 
From: John McKown 
To: git-users@googlegroups.com 
Sent: Sunday, February 03, 2013 5:56 PM
    Subject: Re: [git-users] Compiling Git on Linux..


Ubuntu installed git into /usr/bin. You installed it into /usr/local/bin. 
Normally, /usr/bin is before /usr/local/bin on the PATH. You can address this 
by putting /usr/local/bin on the PATH before /usr/bin. Or you, if you want to 
replace git, use the normal Ubuntu method to uninstall git. This will remove it 
from /usr/bin, allowing the system to find your version in /usr/local/bin. 
Lastly, you can invoke your version by entering:

/usr/local/bin/git

On Feb 3, 2013 11:34 AM, "Philip Oakley"  wrote:

  I have recently got a spare laptop and installed Linux (I've been on 
Windows since 3.1, and stuff before that) , and I'm trying to get my head 
around some of the Git install issues on Linux. In particular how to compile my 
own version of Git, separate from the installed version.

  I've got Ubuntu
  Description:Ubuntu 12.04.2 LTS
  Release:12.04
  Codename:   precise

  I used
  https://www.digitalocean.com/community/articles/how-to-install-git-on 
ubuntu-12-04 to confirm I had the latest update and dependencies,

  and then 'cd repos/git' where I had cloned the git source (my own repo), 
rather than getting the tar.

  I then compiled with 'make prefix=/usr/local all' and got what I think 
was a successful compile.

  However 'which -a git' gave only one result, /usr/bin/git.
  'git --version' gave 'git version 1.7.9.5' which I believe was the 
original ubuntu apt-get version.

  Where should the compiled version be?, and will it have overwritten my 
previous 'apt-get git', or have I missed out an 'install' step.

  Philip

  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2897 / Virus Database: 2639/6076 - Release Date: 02/02/13

  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 2013.0.2897 / Virus Database: 2639/6076 - Release Date: 02/02/13


  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
   
   

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread John McKown
Thanks for the info, I'm not familiar with Ubuntu.
On Feb 3, 2013 3:04 PM, "Martin Møller Skarbiniks Pedersen" <
traxpla...@gmail.com> wrote:

> On 3 February 2013 18:56, John McKown 
> wrote:
> > Ubuntu installed git into /usr/bin. You installed it into /usr/local/bin.
> > Normally, /usr/bin is before /usr/local/bin on the PATH. You can address
> > this by putting /usr/local/bin on the PATH before /usr/bin.
>
> Normally /usr/local/bin/ is _before_ /usr/bin/ in the PATH
>
> /Martin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread Martin Møller Skarbiniks Pedersen
On 3 February 2013 18:56, John McKown  wrote:
> Ubuntu installed git into /usr/bin. You installed it into /usr/local/bin.
> Normally, /usr/bin is before /usr/local/bin on the PATH. You can address
> this by putting /usr/local/bin on the PATH before /usr/bin.

Normally /usr/local/bin/ is _before_ /usr/bin/ in the PATH

/Martin

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread Philip Oakley
That was a useful start, I also realised I hadn't made sure I'd checked out the 
right working tree (my repo has both the Msysgit version and Junio's versio). 
The /usr/local/bin directory was empty, but at least I've now got a clue as to 
where to start looking, and I've now checked may path is set up ;-) .
  - Original Message - 
  From: John McKown 
  To: git-users@googlegroups.com 
  Sent: Sunday, February 03, 2013 5:56 PM
  Subject: Re: [git-users] Compiling Git on Linux..


  Ubuntu installed git into /usr/bin. You installed it into /usr/local/bin. 
Normally, /usr/bin is before /usr/local/bin on the PATH. You can address this 
by putting /usr/local/bin on the PATH before /usr/bin. Or you, if you want to 
replace git, use the normal Ubuntu method to uninstall git. This will remove it 
from /usr/bin, allowing the system to find your version in /usr/local/bin. 
Lastly, you can invoke your version by entering:

  /usr/local/bin/git

  On Feb 3, 2013 11:34 AM, "Philip Oakley"  wrote:

I have recently got a spare laptop and installed Linux (I've been on 
Windows since 3.1, and stuff before that) , and I'm trying to get my head 
around some of the Git install issues on Linux. In particular how to compile my 
own version of Git, separate from the installed version.

I've got Ubuntu
Description:Ubuntu 12.04.2 LTS
Release:12.04
Codename:   precise

I used
https://www.digitalocean.com/community/articles/how-to-install-git-on 
ubuntu-12-04 to confirm I had the latest update and dependencies,

and then 'cd repos/git' where I had cloned the git source (my own repo), 
rather than getting the tar.

I then compiled with 'make prefix=/usr/local all' and got what I think was 
a successful compile.

However 'which -a git' gave only one result, /usr/bin/git.
'git --version' gave 'git version 1.7.9.5' which I believe was the original 
ubuntu apt-get version.

Where should the compiled version be?, and will it have overwritten my 
previous 'apt-get git', or have I missed out an 'install' step.

Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
   
   

  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 2013.0.2897 / Virus Database: 2639/6076 - Release Date: 02/02/13

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread John McKown
Ubuntu installed git into /usr/bin. You installed it into /usr/local/bin.
Normally, /usr/bin is before /usr/local/bin on the PATH. You can address
this by putting /usr/local/bin on the PATH before /usr/bin. Or you, if you
want to replace git, use the normal Ubuntu method to uninstall git. This
will remove it from /usr/bin, allowing the system to find your version in
/usr/local/bin. Lastly, you can invoke your version by entering:

/usr/local/bin/git
On Feb 3, 2013 11:34 AM, "Philip Oakley"  wrote:

> I have recently got a spare laptop and installed Linux (I've been on
> Windows since 3.1, and stuff before that) , and I'm trying to get my head
> around some of the Git install issues on Linux. In particular how to
> compile my own version of Git, separate from the installed version.
>
> I've got Ubuntu
> Description:Ubuntu 12.04.2 LTS
> Release:12.04
> Codename:   precise
>
> I used
> https://www.digitalocean.com/**community/articles/how-to-**install-git-onubuntu-12-04
>  to confirm I had the latest update and dependencies,
>
> and then 'cd repos/git' where I had cloned the git source (my own repo),
> rather than getting the tar.
>
> I then compiled with 'make prefix=/usr/local all' and got what I think was
> a successful compile.
>
> However 'which -a git' gave only one result, /usr/bin/git.
> 'git --version' gave 'git version 1.7.9.5' which I believe was the
> original ubuntu apt-get version.
>
> Where should the compiled version be?, and will it have overwritten my
> previous 'apt-get git', or have I missed out an 'install' step.
>
> Philip
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> git-users+unsubscribe@**googlegroups.com
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] Compiling Git on Linux..

2013-02-03 Thread Dale R. Worley
> From: Philip Oakley 
> 
> I then compiled with 'make prefix=/usr/local all' and got what I think 
> was a successful compile.

I don't know how to compile Git, but the general practice in Unix
builds is for "make" to *compile* the needed code, but only into files
within the source/build directories.  Then one does "make install" to
copy the compiled files into their intended destination locations.

There is usually a text file named README or INSTALL that described
the particular make commands needed to build and install the package.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.