{"thread":{"id":"44436","subject":"git submodule add broken (2.11.0-rc1): Cannot open git-sh-i18n","startedAt":"2016-11-07T17:27:16Z","lastAt":"2016-11-09T05:56:26Z","messageCount":4,"participants":["Anthony Sottile","Stefan Beller","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"305490","messageId":"CA+dzEBmP2aUit00ukJyQeg=iqUJJLVaovafo2gngf9MvEqZDPA@mail.gmail.com","threadId":"44436","inReplyTo":null,"subject":"git submodule add broken (2.11.0-rc1): Cannot open git-sh-i18n","fromName":"Anthony Sottile","fromEmail":"asottile@umich.edu","sentAt":"2016-11-07T17:27:10Z","receivedAt":"2016-11-07T17:27:16Z","isPatch":false,"sender":{"key":"asottile@umich.edu","avatar":"https://avatars.githubusercontent.com/u/1810591?v=4"},"body":"Noticed as part of my automated tests here:\nhttps://travis-ci.org/pre-commit/pre-commit/jobs/173957051\n\nMinimal reproduction:\n\nrm -rf /tmp/git /tmp/foo /tmp/bar\ngit clone git://github.com/git/git --depth 1 /tmp/git\npushd /tmp/git\nmake -j 8\npopd\nexport PATH=\"/tmp/git:$PATH\"\ngit init /tmp/foo\ngit init /tmp/bar\ncd /tmp/foo\ngit submodule add /tmp/bar baz\n\nOutput:\n\n$ rm -rf /tmp/git /tmp/foo /tmp/bar\n$ git clone git://github.com/git/git --depth 1 /tmp/git\nCloning into '/tmp/git'...\nremote: Counting objects: 3074, done.\nremote: Compressing objects: 100% (2735/2735), done.\nremote: Total 3074 (delta 249), reused 1871 (delta 215), pack-reused 0\nReceiving objects: 100% (3074/3074), 6.38 MiB | 905.00 KiB/s, done.\nResolving deltas: 100% (249/249), done.\nChecking connectivity... done.\n$ pushd /tmp/git\n/tmp/git /tmp\n$ make -j 8\nGIT_VERSION = 2.11.0-rc0\n\n... lots of make output ...\n\n$ popd\n/tmp\n$ export PATH=\"/tmp/git:$PATH\"\n$ git init /tmp/foo\nwarning: templates not found /home/asottile/share/git-core/templates\nInitialized empty Git repository in /tmp/foo/.git/\n$ git init /tmp/bar\nwarning: templates not found /home/asottile/share/git-core/templates\nInitialized empty Git repository in /tmp/bar/.git/\n$ cd /tmp/foo\n$ git submodule add /tmp/bar baz\n/tmp/git/git-submodule: 46: .: Can't open\n/home/asottile/libexec/git-core/git-sh-i18n\n$ echo $?\n2\n\n\nThanks\n\nAnthony\n"},{"id":"305494","messageId":"CAGZ79kYbrDu=9Hw+SBnubSHKOc8HmGPb721ZJQxGWW2egqmuDg@mail.gmail.com","threadId":"44436","inReplyTo":"CA+dzEBmP2aUit00ukJyQeg=iqUJJLVaovafo2gngf9MvEqZDPA@mail.gmail.com","subject":"Re: git submodule add broken (2.11.0-rc1): Cannot open git-sh-i18n","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-11-07T17:56:02Z","receivedAt":"2016-11-07T17:56:26Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"    $ git --version\n    git version 1.8.5.6\n    $ if [ \"$LATEST_GIT\" = \"1\" ]; then\n    ...\n         export PATH=\"/tmp/git:$PATH\"\n     fi\n    ....\n    make -j 8\n    ...\n    $ git --version\n    git version 2.11.0-rc0\n\nSo you compile 2.11.0-rc0 yourself, but you do not install it, instead\nthe $PATH is pointed to /tmp/git instead, however the later calls fail with:\n\n    Can't open /home/travis/libexec/git-core/git-sh-i18n\n\nwhich is where 1.8.5.6 is installed.\n\nSo you're running into an internationalization problem\nbetween 2 very different versions of Git (1.8 seems to be ancient)\n\nNot sure if i can offer advice except from\n\"Don't do that, instead install Git properly\". ;)\n\nThanks,\nStefan\n"},{"id":"305496","messageId":"CAGZ79kbyM0ssz3JgeNHsUpvHnBsCbhm-tHvHRp3+6O1QvmkYpw@mail.gmail.com","threadId":"44436","inReplyTo":"CA+dzEBnDZGsYyZkSO5E+3EX+d1j7Kb4kiY6OkC0mtwaq5px5aQ@mail.gmail.com","subject":"Re: git submodule add broken (2.11.0-rc1): Cannot open git-sh-i18n","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-11-07T18:34:40Z","receivedAt":"2016-11-07T18:34:50Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Mon, Nov 7, 2016 at 10:30 AM, Anthony Sottile <asottile@umich.edu> wrote:\n> This has worked great up until now (and is very convenient for trying things\n> out without blowing away the system installation).  What changed?\n>\n\n(Just guessing myself:)\n\n$ git log --grep git-sh-i18n v2.10.0..v2.11.0-rc0\ncommit da14d73d5eacfb2fa9d054f94d9eecb2244c3ce5\nMerge: 2f445c17e5 1073094f30\nAuthor: Junio C Hamano <gitster@pobox.com>\nDate:   Mon Oct 31 13:15:25 2016 -0700\n\n    Merge branch 'ak/sh-setup-dot-source-i18n-fix'\n\n    Recent update to git-sh-setup (a library of shell functions that\n    are used by our in-tree scripted Porcelain commands) included\n    another shell library git-sh-i18n without specifying where it is,\n    relying on the $PATH.  This has been fixed to be more explicit by\n    prefixing $(git --exec-path) output in front.\n\n    * ak/sh-setup-dot-source-i18n-fix:\n      git-sh-setup: be explicit where to dot-source git-sh-i18n from.\n\ncommit 1073094f30a8dd5ae49f2146f587085c4fe86410\nAuthor: Anders Kaseorg <andersk@mit.edu>\nDate:   Sat Oct 29 22:10:02 2016 -0400\n\n    git-sh-setup: be explicit where to dot-source git-sh-i18n from.\n\n    d323c6b641 (\"i18n: git-sh-setup.sh: mark strings for translation\",\n    2016-06-17) started to dot-source git-sh-i18n shell script library,\n    assuming that $PATH is already adjusted for our scripts, namely,\n    $GIT_EXEC_PATH is at the beginning of $PATH.\n\n    Old contrib scripts like contrib/convert-grafts-to-replace-refs.sh\n    and contrib/rerere-train.sh and third-party scripts like guilt may\n    however be using this as \". $(git --exec-path)/git-sh-setup\",\n    without satisfying that assumption.  Be more explicit by specifying\n    its path prefixed with \"$(git --exec-path)/\". to be safe.\n\n    While we’re here, move the sourcing of git-sh-i18n below the shell\n    portability fixes.\n\n    Signed-off-by: Anders Kaseorg <andersk@mit.edu>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n"},{"id":"305614","messageId":"xmqqy40t9oxr.fsf@gitster.mtv.corp.google.com","threadId":"44436","inReplyTo":"CAGZ79kbyM0ssz3JgeNHsUpvHnBsCbhm-tHvHRp3+6O1QvmkYpw@mail.gmail.com","subject":"Re: git submodule add broken (2.11.0-rc1): Cannot open git-sh-i18n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-11-08T21:31:33Z","receivedAt":"2016-11-09T05:56:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> On Mon, Nov 7, 2016 at 10:30 AM, Anthony Sottile <asottile@umich.edu> wrote:\n>> This has worked great up until now (and is very convenient for trying things\n>> out without blowing away the system installation).  What changed?\n>>\n>\n> (Just guessing myself:)\n>\n> $ git log --grep git-sh-i18n v2.10.0..v2.11.0-rc0\n> ...\n> commit 1073094f30a8dd5ae49f2146f587085c4fe86410\n> Author: Anders Kaseorg <andersk@mit.edu>\n> Date:   Sat Oct 29 22:10:02 2016 -0400\n>\n>     git-sh-setup: be explicit where to dot-source git-sh-i18n from.\n>\n>     d323c6b641 (\"i18n: git-sh-setup.sh: mark strings for translation\",\n>     2016-06-17) started to dot-source git-sh-i18n shell script library,\n>     assuming that $PATH is already adjusted for our scripts, namely,\n>     $GIT_EXEC_PATH is at the beginning of $PATH.\n> ...\n\nBefore that one since v2.10.0, there ie d323c6b641 that starts to\ninclude git-sh-i18n from git-sh-setup in the first place.  If you are\ntesting or using a newly-out-of-oven uninstalled Git, you would need\nto do these to be correctly using it:\n\n * Many subcommand executables and helpers are not installed on any\n   directory on your $PATH, but are installed in GIT_EXEC_PATH.\n   Find out where it is by asking the newly-out-of-oven Git \"git\n   --exec-path\" without setting GIT_EXEC_PATH environment variable.\n   That is where your newly built one wants to find things.\n\n * Because you are trying to use the newly-out-of-oven Git without\n   installing, you do not want to install into the real\n   GIT_EXEC_PATH location yet.  Pick a new empty directory and\n   arrange the files that would be installed by our Makefile into\n   \"git --exec-path\" if you did \"make install\" to be in this new\n   location.  The set of files include git-sh-setup and git-sh-i18n.\n\n * Set and export GIT_EXEC_PATH to point at this new empty directory\n   you just populated.\n\nThat incidentally is how we make our \"make test\" work.\n\nIf you only set $PATH to the top of git build directory, without\ndoing the above arrangement with GIT_EXEC_PATH, things may have\nappeared to work due to multitude of accidents.  Builtin commands\nwould worked fine because it is just a single \"git\" binary after\nall, i.e. \"git log\" would not have consulted a \"git-log\" binary on\nanywhere in your filesystem.  Other commands may have been run from\nthe already installed version on the system.  The latter is\nparticularly problematic, because it means that one thought that one\nis testing the newly built on before installing to make sure that\nthe new one works OK, but is actually testing the already installed\none.\n"}]}