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

Re: [RFC PATCH 0/3] git-p4: move to toplevel

From
PWPete Wyckoff <pw@padd.com>
Date
Feb 13, 2012, 23:32 UTC
Message-ID
<20120213233245.GA29582@padd.com>
In-Reply-To
<7vhayuctwm.fsf@alter.siamese.dyndns.org>
gitster@pobox.com wrote on Mon, 13 Feb 2012 13:20 -0800:
Show 24 quoted lines
> Clemens Buchacher <drizzd@aon.at> writes:
> 
> >> Erm,... do you really need the alias if you add git-p4 in a directory on
> >> your $PATH?
> >
> > With recent git versions, this has stopped working.
> 
> Erm, I am confused.
> 
> 	$ git --exec-path
> 	/home/junio/g/Debian-6.X-x86_64/git-jch/libexec/git-core
> 	$ type git-hello
> 	bash: type: git-hello: not found
> 	$ cat >~/bin/common/git-hello <<EOF
> 	#!/bin/sh
> 	echo hello world
> 	EOF
> 	$ chmod +x ~/bin/common/git-hello
> 	$ type git-hello
> 	git-hello is /home/junio/bin/common/git-hello
> 	$ git hello
> 	hello world
> 
> What am I missing???

Neat. I never knew this worked. That lets me remove quite a few aliases. Apparently this has been possible since the conversion from git.sh to git.c.

I tried to find where in the documentation this is talked about, or where it should go. This doesn't feel like the best spot, though.

------------8<-----------
>From 574669898aa891ffe3e785b280ac36177116658e Mon Sep 17 00:00:00 2001
From: Pete Wyckoff <pw@padd.com>
Date: Mon, 13 Feb 2012 18:17:10 -0500
Subject: [PATCH] document git-<command> can be found in PATH
Explain up front to users that arbitrary git "commands" can
be found anywhere in the PATH.  For example, ~/bin/git-hello
will be invoked by "git hello".
---
 Documentation/git.txt |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index f7e201f..0ef7f40 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -30,6 +30,8 @@ introduction.
 
 The '<command>' is either a name of a Git command (see below) or an alias
 as defined in the configuration file (see linkgit:git-config[1]).
+A '<command>' can also refer to an executable with the name git-'<command>'
+anywhere in your PATH.
 
 Formatted and hyperlinked version of the latest git
 documentation can be viewed at
-- 
1.7.9.193.g1d4a5.dirty
Previous: Junio C HamanoNext: Clemens Buchacher
Message 11 of 16 in “git-p4: move to toplevel”
  1. 0/3 git-p4: move to toplevelPete Wyckoff, Feb 12, 2012
  2. 1/3 git-p4: move to toplevelPete Wyckoff, Feb 12, 2012
  3. 2/3 git p4: update name in scriptPete Wyckoff, Feb 12, 2012
  4. 3/3 git p4: use "git p4" directly in testsPete Wyckoff, Feb 12, 2012
  5. Luke DiamandFeb 12, 2012
  6. Junio C HamanoFeb 13, 2012
  7. Pete WyckoffFeb 13, 2012
  8. Junio C HamanoFeb 13, 2012
  9. Clemens BuchacherFeb 13, 2012
  10. Junio C HamanoFeb 13, 2012
  11. Pete WyckoffFeb 13, 2012
  12. Clemens BuchacherFeb 14, 2012
  13. Junio C HamanoFeb 14, 2012
  14. Jeff KingFeb 14, 2012
  15. Junio C HamanoFeb 14, 2012
  16. Clemens BuchacherFeb 14, 2012

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.