git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <junkio@cox.net>
Date
Nov 15, 2006, 19:04 UTC
Message-ID
<7vodr8mszc.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<FE74AC4E0A23124DA52B99F17F44159701A11D6D@PA-EXCH03.vmware.com>
"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.

Previous: Bhavesh Davda
Message 2 of 2 in “RE: [GIT PATCH] Makefile missing git-runstatus in PROGRAMS list”
  1. Bhavesh DavdaNov 15, 2006
  2. Junio C HamanoNov 15, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.