{"thread":{"id":"23798","subject":"interactive rebase editor pathname variable","startedAt":"2010-05-13T18:32:35Z","lastAt":"2010-05-14T12:49:48Z","messageCount":3,"participants":["Neal Kreitzinger","Jonathan Nieder","Bert Wesarg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"141603","messageId":"hshglg$p2q$1@dough.gmane.org","threadId":"23798","inReplyTo":null,"subject":"interactive rebase editor pathname variable","fromName":"Neal Kreitzinger","fromEmail":"neal@rsss.com","sentAt":"2010-05-13T18:32:35Z","receivedAt":"2010-05-13T18:32:35Z","isPatch":false,"sender":{"key":"neal@rsss.com","avatar":null},"body":"Hi,\n\nIt appears that git-commit and git-tag pass a partial pathname to the \ncore.editor, e.g. \".git/COMMIT_EDITMSG\" that is relative to the working tree \ndirectory.  However, git-rebase -i passes an absolute pathname to the \ncore.editor, e.g. \n\"home/someuser/someworkingtree/.git/rebase-merge/git-rebase-todo\".  This \ncauses problems in our shop because our proprietary editor cannot handle \npathnames beginning with a period (it translates the period to a slash) and \ntherefore our entry for core.editor is 'someeditor \"$PWD/$1\"'.  This breaks \non git rebase -i when the $1 contains the full pathname.  Can this be added \nto the bugfix list for git to make the $1 value passed to core.editor by all \ngit commands to always be relative pathnames (or absolute pathnames).  FWIW, \nI prefer absolute pathnames because a config entry of 'someeditor $1' is \nmore straightforward than 'someeditor \"$PWD/$1\"'.  (Note:  the reason I must \npass $1 is because the editor runs on top of a runtime and is actually \ncalled as 'someruntime someeditor \"$1\"')\n\nv/r,\nNeal \n"},{"id":"141638","messageId":"20100514075913.GA3690@progeny.tock","threadId":"23798","inReplyTo":"hshglg$p2q$1@dough.gmane.org","subject":"Re: interactive rebase editor pathname variable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-05-14T07:59:14Z","receivedAt":"2010-05-14T07:59:14Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Neal,\n\nNeal Kreitzinger wrote:\n\n> git-rebase -i passes an absolute pathname to the \n> core.editor, e.g. \n> \"home/someuser/someworkingtree/.git/rebase-merge/git-rebase-todo\".  This \n> causes problems in our shop because our proprietary editor cannot handle \n> pathnames beginning with a period (it translates the period to a slash) and \n> therefore our entry for core.editor is 'someeditor \"$PWD/$1\"'.\n\nFor your example, git uses the shell to run the following command.\n\n  someeditor \"$PWD/$1\" \"$@\"\n\nI would suggest something like the following instead.\n\n  [core]\n\teditor = \"sh -c '\\\n\t\tcase \\\"$1\\\" in \\\n\t\t/*|[A-Za-z]:*) file=\\\"$1\\\";; \\\n\t\t*) file=\\\"$(pwd)/$1\\\";; \\\n\t\tesac; \\\n\t\tsomeruntime someditor \\\"$file\\\"' -\"\n\nHope that helps,\nJonathan\n"},{"id":"141668","messageId":"AANLkTimb8fCQoX31GkPqsjtnKgi6TLlUPToodZcZocHJ@mail.gmail.com","threadId":"23798","inReplyTo":"20100514075913.GA3690@progeny.tock","subject":"Re: interactive rebase editor pathname variable","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-05-14T12:49:48Z","receivedAt":"2010-05-14T12:49:48Z","isPatch":false,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Fri, May 14, 2010 at 09:59, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi Neal,\n>\n> Neal Kreitzinger wrote:\n>\n>> git-rebase -i passes an absolute pathname to the\n>> core.editor, e.g.\n>> \"home/someuser/someworkingtree/.git/rebase-merge/git-rebase-todo\".  This\n>> causes problems in our shop because our proprietary editor cannot handle\n>> pathnames beginning with a period (it translates the period to a slash) and\n>> therefore our entry for core.editor is 'someeditor \"$PWD/$1\"'.\n>\n> For your example, git uses the shell to run the following command.\n>\n>  someeditor \"$PWD/$1\" \"$@\"\n>\n> I would suggest something like the following instead.\n>\n>  [core]\n>        editor = \"sh -c '\\\n>                case \\\"$1\\\" in \\\n>                /*|[A-Za-z]:*) file=\\\"$1\\\";; \\\n>                *) file=\\\"$(pwd)/$1\\\";; \\\n>                esac; \\\n>                someruntime someditor \\\"$file\\\"' -\"\n>\n\nBarely tested:\n\nsomeditor \"$PWD/${1/#$PWD\\//}\"\n\nBert\n\n> Hope that helps,\n> Jonathan\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"}]}