# Re: [GIT PATCH] Makefile missing git-runstatus in PROGRAMS list

2 messages from 2006-11-15 to 2006-11-15. Participants: Junio C Hamano, Bhavesh Davda.
Thread: https://gitlist.dev/t/43227

## Bhavesh Davda, 2006-11-15 18:42

Subject: RE: [GIT PATCH] Makefile missing git-runstatus in PROGRAMS list
Message-ID: <FE74AC4E0A23124DA52B99F17F44159701A11D6D@PA-EXCH03.vmware.com>
URL: https://gitlist.dev/e/FE74AC4E0A23124DA52B99F17F44159701A11D6D%40PA-EXCH03.vmware.com

```
> 
> > Attached is my attempt at the same command "make 
> prefix=/var/tmp/ggg clean
> > all install"
> >
> > make install failes for the templates directory, leading to 
> the entire make
> > install failing:
> >
> > make -C templates DESTDIR='' install
> > make[1]: Entering directory `/VMware/kernel/git/git/templates'
> > : no custom templates yet
> > install -d -m755 '/var/tmp/ggg/share/git-core/templates/'
> > (cd blt && tar cf - .) | \
> > (cd '/var/tmp/ggg/share/git-core/templates/' && tar xf -)
> > tar: This does not look like a tar archive
> > tar: Skipping to next header
> > tar: Archive contains obsolescent base-64 headers
> > tar: Error exit delayed from previous errors
> 
> I have a feeling that you have CDPATH exported to the
> environment, which is a braindamage.  It is a fine usability
> helper for interactive shells so I do not have problem with
> people setting that in shell as shell variables, though.
> 
> In other words, never do "export CDPATH=..." nor "export CDPATH".
> 
> 

Indeed! I had "export CDPATH=.:$HOME" in my $HOME/.bash_profile.

"export -n CDPATH", and now "make install" works, setting up those hard links
too.

If this is a common gotcha in building and installing git, maybe you should
add it near the top of the INSTALL instructions.

I haven't run into this issue with other projects. Is there something that
can be changed in git's Makefile so it works even if CDPATH is set and
exported in people's environments? What about simply not naming the subdir
blt for both source and install directories under templates?

Thanks!


```

## Junio C Hamano, 2006-11-15 19:04

Subject: Re: [GIT PATCH] Makefile missing git-runstatus in PROGRAMS list
Message-ID: <7vodr8mszc.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vodr8mszc.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <FE74AC4E0A23124DA52B99F17F44159701A11D6D@PA-EXCH03.vmware.com>

```
"Bhavesh Davda" <bhavesh@vmware.com> writes:

> Indeed! I had "export CDPATH=.:$HOME" in my $HOME/.bash_profile.
>
> "export -n CDPATH", and now "make install" works, setting up those hard links
> too.
>
> If this is a common gotcha in building and installing git, maybe you should
> add it near the top of the INSTALL instructions.
>
> I haven't run into this issue with other projects. Is there something that
> can be changed in git's Makefile so it works even if CDPATH is set and
> exported in people's environments?

I think we already had this discussed twice on this list.

The problem is not just Makefile, but any command implemented as
shell scripts, if it needs to "cd" inside, is bitten by exported
CDPATH not just because it gives unwanted output to stdout
(which is already stupid -- CDPATH is purely convenience for
interactive session) but also because it would take the process
to unexpected places.

You can solve it by three ways.  (1) unset CDPATH at the
beginning of every shell script; (2) write all internal "cd" in
such a way that CDPATH would not try to interfere with it; (3)
teach users to fix their broken environment.

We do (1) for our shell scripts with git-sh-setup which almost
all other script sources, along with a comment for (3) at that
place.  As you say we should probably add the same to INSTALL
instructions.

```
