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

What's cooking in git.git

From
Junio C Hamano <junkio@cox.net>
Date
Jan 14, 2006, 03:45 UTC
Message-ID
<7vvewnwjzy.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vhd8al3ae.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 6 quoted lines
>  - Exec git programs without using PATH (Michal Ostrowski).
>
>    This has been discussed for the last couple of days on the
>    list.  I think C side is ready to go in, but I'd like to
>    decide what to do on the scripting side before merging it
>    into the master branch.

I've done a minor fix in the Makefile (things were installed in the wrong way around --- $bindir should hold git and gitk and $gitexecdir should hold the rest), and ran a brief test after installing things with gitexecdir set to /usr/lib/git-core/x. gitk needs to be taught to use git --exec-path upfront to set its own PATH, but other than that, everything looks peachy.

About prepending to/appending to/not touching PATH, my current thinking is that prepending is the way to go. The best rationale so far I have heard against mucking with PATH was "/home/mo/bin/diff vs /usr/bin/diff" issue, but I do not find this to be so convincing in practice. This "use my diff not system diff" is done most often when system diff is not GNU enough, but on such a machine git will not be installed under /usr/bin anyway (after all git prefers GNU diff).

And this becomes truly a non-issue when you point $gitexecdir at a separate location that holds *only* git stuff. Everybody will find the matching version of git that way, and when looking for "diff", it will be found from one of the directories in the rest of the PATH, not from $gitexecdir.

So unless there is an objection, this will graduate into the "master" branch over the weekend.

What happens if gitexecdir != bindir?

As long as the user invokes "git foo" from the command line, not "git-foo", everything should work fine, and once gitk is updated, binary distributions could ship git with only git and gitk in /usr/bin and others in /usr/lib/git-core/tools, or something like that.

I will _not_ change the default gitexecdir in my Makefile nor change the spec file, so RPM binary from kernel.org will still have everything in /usr/bin for now.

Somebody needs to audit how ready popular Porcelains are, for at least Cogito, stgit, gitweb and qgit and feed patches to respective authors as necessary. I haven't looked into any of them about this issue. The rules are:

    (1) you can assume "git" is available on PATH;
    (2) you should be safe if you do not use "git-foo" form;
    (3) you can run
        PATH="$(git --exec-path):$PATH"; export PATH
        once at the beginning of your program and use "git-foo"
        form.
Volunteers?
Previous: Junio C HamanoNext: Petr Baudis
Message 2 of 3 in “What's cooking in git.git”
  1. Junio C HamanoJan 12, 2006
  2. Junio C HamanoJan 14, 2006
  3. Petr BaudisJan 16, 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.