{"thread":{"id":"4880","subject":"[PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.","startedAt":"2006-07-14T04:46:55Z","lastAt":"2006-07-14T23:28:41Z","messageCount":4,"participants":["Shawn Pearce","Matthias Lederhofer","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"23797","messageId":"20060714044655.GA1982@spearce.org","threadId":"4880","inReplyTo":null,"subject":"[PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-07-14T04:46:55Z","receivedAt":"2006-07-14T04:46:55Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ideally 'shipped' commands (e.g. git-rebase) should avoid calling\nthe git wrapper when executing other commands to prevent the user\nfrom shadowing those commands with aliases and causing the shipped\ncommand behavior to differ unexpectedly.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n git-rebase.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 1b9e986..6d06665 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -131,7 +131,7 @@ do\n \t\t\tfinish_rb_merge\n \t\t\texit\n \t\tfi\n-\t\tgit am --resolved --3way --resolvemsg=\"$RESOLVEMSG\"\n+\t\tgit-am --resolved --3way --resolvemsg=\"$RESOLVEMSG\"\n \t\texit\n \t\t;;\n \t--skip)\n@@ -150,7 +150,7 @@ do\n \t\t\tfinish_rb_merge\n \t\t\texit\n \t\tfi\n-\t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\"\n+\t\tgit-am -3 --skip --resolvemsg=\"$RESOLVEMSG\"\n \t\texit\n \t\t;;\n \t--abort)\n@@ -163,7 +163,7 @@ do\n \t\telse\n \t\t\tdie \"No rebase in progress?\"\n \t\tfi\n-\t\tgit reset --hard ORIG_HEAD\n+\t\tgit-reset --hard ORIG_HEAD\n \t\texit\n \t\t;;\n \t--onto)\n@@ -231,7 +231,7 @@ esac\n \n # The upstream head must be given.  Make sure it is valid.\n upstream_name=\"$1\"\n-upstream=`git rev-parse --verify \"${upstream_name}^0\"` ||\n+upstream=`git-rev-parse --verify \"${upstream_name}^0\"` ||\n     die \"invalid upstream $upstream_name\"\n \n # If a hook exists, give it a chance to interrupt\n@@ -250,7 +250,7 @@ case \"$#\" in\n \tgit-checkout \"$2\" || usage\n \t;;\n *)\n-\tbranch_name=`git symbolic-ref HEAD` || die \"No current branch\"\n+\tbranch_name=`git-symbolic-ref HEAD` || die \"No current branch\"\n \tbranch_name=`expr \"z$branch_name\" : 'zrefs/heads/\\(.*\\)'`\n \t;;\n esac\n@@ -288,7 +288,7 @@ fi\n if test -z \"$do_merge\"\n then\n \tgit-format-patch -k --stdout --full-index \"$upstream\"..ORIG_HEAD |\n-\tgit am --binary -3 -k --resolvemsg=\"$RESOLVEMSG\"\n+\tgit-am --binary -3 -k --resolvemsg=\"$RESOLVEMSG\"\n \texit $?\n fi\n \n-- \n1.4.1.gd3d5\n"},{"id":"23823","messageId":"E1G1QFc-0006FY-KE@moooo.ath.cx","threadId":"4880","inReplyTo":"20060714044655.GA1982@spearce.org","subject":"Re: [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-07-14T16:10:48Z","receivedAt":"2006-07-14T16:10:48Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Shawn Pearce <spearce@spearce.org> wrote:\n> Ideally 'shipped' commands (e.g. git-rebase) should avoid calling\n> the git wrapper when executing other commands to prevent the user\n> from shadowing those commands with aliases and causing the shipped\n> command behavior to differ unexpectedly.\nHow did you alias an existing command so that the alias gets executed?\nThat is what I get:\n% git repo-config alias.am ls-tree\n% GIT_TRACE=1 git am\ntrace: exec: '/home/matled/local/stow/git/bin/git-am'\n"},{"id":"23824","messageId":"7vpsg8qhj9.fsf@assigned-by-dhcp.cox.net","threadId":"4880","inReplyTo":"20060714044655.GA1982@spearce.org","subject":"Re: [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-14T16:26:34Z","receivedAt":"2006-07-14T16:26:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shawn Pearce <spearce@spearce.org> writes:\n\n> Ideally 'shipped' commands (e.g. git-rebase) should avoid calling\n> the git wrapper when executing other commands to prevent the user\n> from shadowing those commands with aliases and causing the shipped\n> command behavior to differ unexpectedly.\n\nIn order to avoid confusion, we made aliases not to shadow real\ncommands, so this is not an argument to support this patch.\n\nOn distros that package git with gitexecdir set to somewhere not\non normal user $PATH, users are expected to use \"git\" wrapper to\ninvoke any commands (including git-rebase, so the user would say\n\"git rebase\"), and \"git\" wrapper sets up the PATH to contain the\ngitexecdir while it runs the subcommands, so spelling them\neither way, be it \"git am\" or \"git-am\", is just fine.\n\n>\n> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n> ---\n>  git-rebase.sh |   12 ++++++------\n>  1 files changed, 6 insertions(+), 6 deletions(-)\n>\n> diff --git a/git-rebase.sh b/git-rebase.sh\n> index 1b9e986..6d06665 100755\n> --- a/git-rebase.sh\n> +++ b/git-rebase.sh\n> @@ -131,7 +131,7 @@ do\n>  \t\t\tfinish_rb_merge\n>  \t\t\texit\n>  \t\tfi\n> -\t\tgit am --resolved --3way --resolvemsg=\"$RESOLVEMSG\"\n> +\t\tgit-am --resolved --3way --resolvemsg=\"$RESOLVEMSG\"\n>  \t\texit\n>  \t\t;;\n>  \t--skip)\n"},{"id":"23843","messageId":"20060714232841.GA30169@spearce.org","threadId":"4880","inReplyTo":"7vpsg8qhj9.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] Avoid using the git wrapper in git-rebase.sh.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-07-14T23:28:41Z","receivedAt":"2006-07-14T23:28:41Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Shawn Pearce <spearce@spearce.org> writes:\n> \n> > Ideally 'shipped' commands (e.g. git-rebase) should avoid calling\n> > the git wrapper when executing other commands to prevent the user\n> > from shadowing those commands with aliases and causing the shipped\n> > command behavior to differ unexpectedly.\n> \n> In order to avoid confusion, we made aliases not to shadow real\n> commands, so this is not an argument to support this patch.\n\nDoh.  I must have missed the emails which decided that...  For some\nreason I remember only the emails discussing shadowing happening\nbut that internal stuff should use 'git-am' to prevent the shadowing\nfrom occuring.  Thanks for the correction.\n\n-- \nShawn.\n"}]}