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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 16, 2006 at 12:26:09AM -0800, Junio C Hamano wrote:
> 
> 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

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]