threads / patch / 43227

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

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

## tl;dr

2 messages between Nov 15, 2006 and Nov 15, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Bhavesh Davda· Nov 15, 2006, 18:42 UTC · lore

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

Show 28 quoted lines
> 
> > 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· Nov 15, 2006, 19:04 UTC · re: Bhavesh Davda · lore
"Bhavesh Davda" <bhavesh@vmware.com> writes:
Show 11 quoted lines
> 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.

← back to recent threads