git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Stop hiding the error message within 'git submodule add'

From
John Szakmeister <john@szakmeister.net>
Date
Jul 23, 2011, 11:59 UTC
Message-ID
<CAEBDL5VmY-BY9+q2b6pz=rxJKF6HghrbtmamaCzee7xDGf1h-A@mail.gmail.com>
In-Reply-To
<1311419848-79652-1-git-send-email-john@szakmeister.net>

Bah, this broke a test (I must have missed that fact somehow). I'll see if it can be fixed.

-John
On Sat, Jul 23, 2011 at 7:17 AM, John Szakmeister <john@szakmeister.net> wrote:
Show 33 quoted lines
> git-submodule.sh was incorrectly assuming that the only reason
> 'git add --dry-run' would fail was due to ignored paths.  However,
> when trying add a submodule inside of another, the original error
> message was being lost, and leaves a user confused.  Simply
> re-run 'git add --dry-run' and allow the error message emitted.
>
> Signed-off-by: John Szakmeister <john@szakmeister.net>
> ---
>  git-submodule.sh |    7 +------
>  1 files changed, 1 insertions(+), 6 deletions(-)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index bc1d3fa..056abd4 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -223,12 +223,7 @@ cmd_add()
>
>        if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1
>        then
> -               (
> -                       eval_gettext "The following path is ignored by one of your .gitignore files:
> -\$path
> -Use -f if you really want to add it." &&
> -                       echo
> -               ) >&2
> +               git add --dry-run --ignore-missing "$path"
>                exit 1
>        fi
>
> --
> 1.7.6.134.gcf13f6.dirty
>
>
Previous: John Szakmeister
Message 2 of 2 in “Stop hiding the error message within 'git submodule add'”
  1. Stop hiding the error message within 'git submodule add'John Szakmeister, Jul 23, 2011
  2. John SzakmeisterJul 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.