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

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

From
QHQingning Huo <qhuo@mayhq.org>
Date
Mar 16, 2006, 20:33 UTC
Message-ID
<20060316203319.GA20159@localhost.localdomain>
In-Reply-To
<7v64mebxsu.fsf@assigned-by-dhcp.cox.net>
On Thu, Mar 16, 2006 at 12:26:09AM -0800, Junio C Hamano wrote:
Show 43 quoted lines
> 
> We could probably define a shell function that looks like:
> 
>         git_exec () {
>                 cmd="$1"
>                 shift
>                 case "${GIT_EXEC_PATH+set}" in
>                 set) ;;
>                 *) GIT_EXEC_PATH='@@GIT_EXEC_PATH@@' ;;
>                 esac
>                 "$GIT_EXEC_PATH/git-$cmd" "$@"
>         }
> 
> in git-sh-setup [*1*], and then rewrite the above to something
> like this instead:
> 
>         diff --git a/git-commit.sh b/git-commit.sh
>         index 330a434..8a73420 100755
>         --- a/git-commit.sh
>         +++ b/git-commit.sh
>         ...
>         @@ -115,7 +115,7 @@ run_status () {
>                     echo '#
>          # Initial commit
>          #'
>         -	    git-ls-files |
>         +	    git_exec ls-files |
>                     sed -e '
>                             s/\\/\\\\/g
>                             s/ /\\ /g
>         @@ -126,7 +126,7 @@ run_status () {
>                     committable="$?"
>                 fi
> 
>         -	git-diff-files  --name-status |
>         +	git_exec diff-files  --name-status |
>                 sed -e '
>                         s/\\/\\\\/g
>                         s/ /\\ /g
>         ...
> 
> But that does not cover Perl nor Python scripts, and does not
> address the ugliness either.

This is similiar to what I had in mind when I recommended the full path approach. Perl or Python should be able to do the similiar. I have no comment on the ugliness. The functionality and effeciency of the program is more important to me. But I do recognize the difficulties of changing all scripts overnight.

Anyway, there are at least other two ways to solve my problem. (a) setup PATH in git-sh-setup, or (b) consistently use git-command form in scripts. Even before their implementation, I can still use "git push".

Qingning
Previous: Andreas EricssonNext: Junio C Hamano
Message 22 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.