From: Kyle Meyer <kyle@kyleam.com>
To: git@vger.kernel.org
Cc: debian@onerussian.com
Subject: Re: [PATCH 1/4] submodule: refuse to add repository with no commits
Date: Sat, 16 Mar 2019 11:40:09 -0400 [thread overview]
Message-ID: <87lg1eq146.fsf@kyleam.com> (raw)
In-Reply-To: <20190314150219.2040-2-kyle@kyleam.com>
Kyle Meyer <kyle@kyleam.com> writes:
[...]
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 514ede2596..6c74656027 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -234,10 +234,18 @@ cmd_add()
> if test -z "$force" &&
> ! git add --dry-run --ignore-missing --no-warn-embedded-repo "$sm_path" > /dev/null 2>&1
> then
> - eval_gettextln "The following path is ignored by one of your .gitignore files:
> + if test -d "$sm_path" &&
> + test -z $(git -C "$sm_path" rev-parse --show-cdup 2>/dev/null) &&
> + ! git -C "$sm_path" rev-parse --verify -q HEAD >/dev/null
> + then
> + die "$(eval_gettext "'\$sm_path' does not have any commits")"
> + else
> + eval_gettextln "\
> +The following path is ignored by one of your .gitignore files:
> \$sm_path
> Use -f if you really want to add it." >&2
> - exit 1
> + exit 1
> + fi
I didn't think through this check, which would have been obvious had I
ran the added test without the rest of the patches in this series. It
assumes that the 'git add --dry-run' call fails, but that failure
depends on the last patch of this series. So I'd need to move this
patch to the end or find a new place for this "no commits" check.
next prev parent reply other threads:[~2019-03-16 15:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 15:02 [PATCH 0/4] dir: Treat a repository without commits as a repository Kyle Meyer
2019-03-14 15:02 ` [PATCH 1/4] submodule: refuse to add repository with no commits Kyle Meyer
2019-03-16 15:40 ` Kyle Meyer [this message]
2019-04-02 18:35 ` [PATCH v2 0/4] dir: Treat a repository without commits as a repository Kyle Meyer
2019-04-02 18:35 ` [PATCH v2 1/4] submodule: refuse to add repository with no commits Kyle Meyer
2019-04-04 7:24 ` Junio C Hamano
2019-04-02 18:35 ` [PATCH v2 2/4] t3000: move non-submodule repo test to separate file Kyle Meyer
2019-04-03 7:59 ` Junio C Hamano
2019-04-03 22:21 ` Kyle Meyer
2019-04-02 18:35 ` [PATCH v2 3/4] t3009: test that ls-files -o traverses bogus repo Kyle Meyer
2019-04-02 18:35 ` [PATCH v2 4/4] dir: do not traverse repositories with no commits Kyle Meyer
2019-04-03 8:05 ` Junio C Hamano
2019-04-03 22:25 ` Kyle Meyer
2019-03-14 15:02 ` [PATCH 2/4] t3000: move non-submodule repo test to separate file Kyle Meyer
2019-03-14 15:02 ` [PATCH 3/4] t3009: test that ls-files -o traverses bogus repo Kyle Meyer
2019-03-14 15:02 ` [PATCH 4/4] dir: do not traverse repositories with no commits Kyle Meyer
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lg1eq146.fsf@kyleam.com \
--to=kyle@kyleam.com \
--cc=debian@onerussian.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).