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

Re: [PATCH] Invoke git-repo-config directly.

From
Junio C Hamano <junkio@cox.net>
Date
Mar 15, 2006, 23:35 UTC
Message-ID
<7vlkvbffhz.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0603151450070.3618@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 8 quoted lines
> On Wed, 15 Mar 2006, Junio C Hamano wrote:
>> 
>> If we do the dash-form for consistency's sake, we should do
>> PATH="`git --exec-path`:$PATH" in git-setup-sh when/before we do
>> so.
>
> Yes. That would make sense too. Then git-setup-sh would look more like 
> what the builtin git.c does.
I think some historical background is in order.

We started without bindir vs execdir distinction but we wanted a way to someday migrate out of putting everything in bindir. As one part of the solution, "git" wrapper was invented, and as the result of that effort, some parts of the scripts, and lot of documentation pages and sample scripts, lost dashes.

Historically, git tools have always wanted everything git-* to be found on user's PATH, and we were alarmed to see 100+ git-* commands in /usr/bin. That's why "git" wrapper and GIT_EXEC_PATH environment were invented. People can have /usr/bin/git and no other git-* on their PATH, because that "git" knows where to find the rest of git-* commands. For that to work, the scripts should know where to find the rest -- and cleanest way is to run others via "git foo" form.

Consistency via s/git-foo/git foo/g _is_ the goal, but that kind of change interferes with the other patches that do the real work, and it is kind of boring, so nobody has done wholesale clean-up of all the scripts.

Invoking with the full path is not an option -- it makes building and testing-before-installing process too cumbersome. You are welcome to try and send in a patch to do that if (and only if) you volunteer to go the whole nine yards, but I have to warn you that that approach is something we have already considered and discarded, one reason why is because it makes the testsuite unworkable (testing needs to be done before installing).

If you want to use the other "git" (GNU interactive tools, which I once heard is changing its name to gitfm or something like that -- how nice of them -- but has it ever happened?), and if you want to have /usr/bin (which has that "git") and then /other/bin (which has on-topic "git") on your PATH, in that order, that would be a problem. Saying just "git" would invoke other "git" that does not know what to do.

If you can solve that without hardcoding the full path in our scripts, that would be ideal. But otherwise, especially with changing things back to "git-foo" form without making sure going backward in that way would not hinder the migration out of /usr/bin, then that creates more problems than it solves.

So that is why I said I would prefer dashless form.

I _think_ the simplest fix is to change the order of directories you list on your PATH so that "git" is found before GNU interactive tool, which is my impression that most people seem to do (many in fact do not have GNU interactive tool on their PATH anywhere).

Previous: Linus TorvaldsNext: Qingning Huo
Message 12 of 27 in “Invoke git-repo-config directly.”
  1. Invoke git-repo-config directly.Qingning Huo, Mar 14, 2006
  2. Johannes SchindelinMar 14, 2006
  3. Qingning HuoMar 14, 2006
  4. Linus TorvaldsMar 14, 2006
  5. Qingning HuoMar 14, 2006
  6. Linus TorvaldsMar 14, 2006
  7. Qingning HuoMar 15, 2006
  8. Junio C HamanoMar 15, 2006
  9. Junio C HamanoMar 15, 2006
  10. Qingning HuoMar 15, 2006
  11. Linus TorvaldsMar 15, 2006
  12. Junio C HamanoMar 15, 2006
  13. Qingning HuoMar 16, 2006
  14. Junio C HamanoMar 16, 2006
  15. Junio C HamanoMar 16, 2006
  16. Mark WoodingMar 16, 2006
  17. Andreas EricssonMar 16, 2006
  18. Junio C HamanoMar 17, 2006
  19. Mark WoodingMar 17, 2006
  20. Timo HirvonenMar 16, 2006
  21. Andreas EricssonMar 16, 2006
  22. Qingning HuoMar 16, 2006
  23. Junio C HamanoMar 16, 2006
  24. Andreas EricssonMar 16, 2006
  25. Jon LoeligerMar 16, 2006
  26. Jon LoeligerMar 16, 2006
  27. Junio C HamanoMar 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.