* [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.
@ 2006-07-14 4:46 Shawn Pearce
2006-07-14 16:10 ` Matthias Lederhofer
2006-07-14 16:26 ` Junio C Hamano
0 siblings, 2 replies; 4+ messages in thread
From: Shawn Pearce @ 2006-07-14 4:46 UTC (permalink / raw)
To: git
Ideally 'shipped' commands (e.g. git-rebase) should avoid calling
the git wrapper when executing other commands to prevent the user
from shadowing those commands with aliases and causing the shipped
command behavior to differ unexpectedly.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
git-rebase.sh | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 1b9e986..6d06665 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -131,7 +131,7 @@ do
finish_rb_merge
exit
fi
- git am --resolved --3way --resolvemsg="$RESOLVEMSG"
+ git-am --resolved --3way --resolvemsg="$RESOLVEMSG"
exit
;;
--skip)
@@ -150,7 +150,7 @@ do
finish_rb_merge
exit
fi
- git am -3 --skip --resolvemsg="$RESOLVEMSG"
+ git-am -3 --skip --resolvemsg="$RESOLVEMSG"
exit
;;
--abort)
@@ -163,7 +163,7 @@ do
else
die "No rebase in progress?"
fi
- git reset --hard ORIG_HEAD
+ git-reset --hard ORIG_HEAD
exit
;;
--onto)
@@ -231,7 +231,7 @@ esac
# The upstream head must be given. Make sure it is valid.
upstream_name="$1"
-upstream=`git rev-parse --verify "${upstream_name}^0"` ||
+upstream=`git-rev-parse --verify "${upstream_name}^0"` ||
die "invalid upstream $upstream_name"
# If a hook exists, give it a chance to interrupt
@@ -250,7 +250,7 @@ case "$#" in
git-checkout "$2" || usage
;;
*)
- branch_name=`git symbolic-ref HEAD` || die "No current branch"
+ branch_name=`git-symbolic-ref HEAD` || die "No current branch"
branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
;;
esac
@@ -288,7 +288,7 @@ fi
if test -z "$do_merge"
then
git-format-patch -k --stdout --full-index "$upstream"..ORIG_HEAD |
- git am --binary -3 -k --resolvemsg="$RESOLVEMSG"
+ git-am --binary -3 -k --resolvemsg="$RESOLVEMSG"
exit $?
fi
--
1.4.1.gd3d5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.
2006-07-14 4:46 [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh Shawn Pearce
@ 2006-07-14 16:10 ` Matthias Lederhofer
2006-07-14 16:26 ` Junio C Hamano
1 sibling, 0 replies; 4+ messages in thread
From: Matthias Lederhofer @ 2006-07-14 16:10 UTC (permalink / raw)
To: Shawn Pearce; +Cc: git
Shawn Pearce <spearce@spearce.org> wrote:
> Ideally 'shipped' commands (e.g. git-rebase) should avoid calling
> the git wrapper when executing other commands to prevent the user
> from shadowing those commands with aliases and causing the shipped
> command behavior to differ unexpectedly.
How did you alias an existing command so that the alias gets executed?
That is what I get:
% git repo-config alias.am ls-tree
% GIT_TRACE=1 git am
trace: exec: '/home/matled/local/stow/git/bin/git-am'
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.
2006-07-14 4:46 [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh Shawn Pearce
2006-07-14 16:10 ` Matthias Lederhofer
@ 2006-07-14 16:26 ` Junio C Hamano
2006-07-14 23:28 ` Shawn Pearce
1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2006-07-14 16:26 UTC (permalink / raw)
To: Shawn Pearce; +Cc: git
Shawn Pearce <spearce@spearce.org> writes:
> Ideally 'shipped' commands (e.g. git-rebase) should avoid calling
> the git wrapper when executing other commands to prevent the user
> from shadowing those commands with aliases and causing the shipped
> command behavior to differ unexpectedly.
In order to avoid confusion, we made aliases not to shadow real
commands, so this is not an argument to support this patch.
On distros that package git with gitexecdir set to somewhere not
on normal user $PATH, users are expected to use "git" wrapper to
invoke any commands (including git-rebase, so the user would say
"git rebase"), and "git" wrapper sets up the PATH to contain the
gitexecdir while it runs the subcommands, so spelling them
either way, be it "git am" or "git-am", is just fine.
>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
> ---
> git-rebase.sh | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/git-rebase.sh b/git-rebase.sh
> index 1b9e986..6d06665 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -131,7 +131,7 @@ do
> finish_rb_merge
> exit
> fi
> - git am --resolved --3way --resolvemsg="$RESOLVEMSG"
> + git-am --resolved --3way --resolvemsg="$RESOLVEMSG"
> exit
> ;;
> --skip)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.
2006-07-14 16:26 ` Junio C Hamano
@ 2006-07-14 23:28 ` Shawn Pearce
0 siblings, 0 replies; 4+ messages in thread
From: Shawn Pearce @ 2006-07-14 23:28 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano <junkio@cox.net> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
>
> > Ideally 'shipped' commands (e.g. git-rebase) should avoid calling
> > the git wrapper when executing other commands to prevent the user
> > from shadowing those commands with aliases and causing the shipped
> > command behavior to differ unexpectedly.
>
> In order to avoid confusion, we made aliases not to shadow real
> commands, so this is not an argument to support this patch.
Doh. I must have missed the emails which decided that... For some
reason I remember only the emails discussing shadowing happening
but that internal stuff should use 'git-am' to prevent the shadowing
from occuring. Thanks for the correction.
--
Shawn.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-14 23:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-14 4:46 [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh Shawn Pearce
2006-07-14 16:10 ` Matthias Lederhofer
2006-07-14 16:26 ` Junio C Hamano
2006-07-14 23:28 ` Shawn Pearce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).