git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jędrzej Dudkiewicz" <jedrzej.dudkiewicz@gmail.com>
To: git@vger.kernel.org
Subject: Cannot run `git submodule init` on Cygwin from script with strict error checking
Date: Fri, 11 Sep 2020 10:20:39 +0200	[thread overview]
Message-ID: <CABJqhQNh2Qc2Btp==bGUbT-AaSjGdGEmhtphQQyX=nqjWOis0A@mail.gmail.com> (raw)

I'm running git 2.28.0 on Cygwin. I have a script with:

set -aeu

at the beginning (as all scripts should have). In the script I'm trying to run:

git submodule init

When running via "bash -x script.sh", I get:

+ git submodule init
++ basename /usr/libexec/git-core/git-submodule
++ sed -e 's/-/ /'
+ dashless='git submodule'
+ USAGE='[--quiet] [--cached]
   or: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name
<name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
   or: git submodule [--quiet] update [--init] [--remote]
[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase]
[--[no-]recommend-shallow] [--reference <repository>] [--recursive]
[--[no-]single-branch] [--] [<path>...]
   or: git submodule [--quiet] set-branch (--default|--branch
<branch>) [--] <path>
   or: git submodule [--quiet] set-url [--] <path> <newurl>
   or: git submodule [--quiet] summary [--cached|--files]
[--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]'
+ OPTIONS_SPEC=
+ SUBDIRECTORY_OK=Yes
+ . git-sh-setup
++ unset CDPATH
++ IFS='
'
+++ git --exec-path
++ . /usr/libexec/git-core/git-sh-i18n
+++ TEXTDOMAIN=git
+++ export TEXTDOMAIN
/usr/libexec/git-core/git-sh-i18n: line 10: GIT_TEXTDOMAINDIR: unbound variable

(TL;DR: This basically boils down to GIT_TEXTDOMAINDIR being unbound,
i.e. uninitialized/non-existant.)

When I exported GIT_TEXTDOMAINDIR with bogus value from my script
before calling "git submodule init":

export GIT_TEXTDOMAINDIR=/bogus/value

I got (only error shown):

/usr/libexec/git-core/git-sh-i18n: line 20: GIT_TEST_GETTEXT_POISON:
unbound variable

I set it to `false`, restarted and then got:

/usr/libexec/git-core/git-sh-i18n: line 28:
GIT_INTERNAL_GETTEXT_TEST_FALLBACKS: unbound variable

I set it to empty value, restarted and then got:

/usr/libexec/git-core/git-sh-setup: line 91: LONG_USAGE: unbound variable

This is when I gave up.

Same script run with git 2.21.0 on Linux has no problems, but I
haven't compare differences between two versions, so I don't know why
it stopped working.
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.

             reply	other threads:[~2020-09-11  8:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  8:20 Jędrzej Dudkiewicz [this message]
2020-09-11 11:30 ` Cannot run `git submodule init` on Cygwin from script with strict error checking Adam Dinwoodie
2020-09-11 11:46   ` Jędrzej Dudkiewicz
2020-09-11 13:19     ` SZEDER Gábor
2020-09-11 19:07       ` Junio C Hamano
2020-09-15 20:31         ` SZEDER Gábor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABJqhQNh2Qc2Btp==bGUbT-AaSjGdGEmhtphQQyX=nqjWOis0A@mail.gmail.com' \
    --to=jedrzej.dudkiewicz@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).