git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Stop hiding the error message within 'git submodule add'
@ 2011-07-23 11:17 John Szakmeister
  2011-07-23 11:59 ` John Szakmeister
  0 siblings, 1 reply; 2+ messages in thread
From: John Szakmeister @ 2011-07-23 11:17 UTC (permalink / raw)
  To: git; +Cc: John Szakmeister

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Stop hiding the error message within 'git submodule add'
  2011-07-23 11:17 [PATCH] Stop hiding the error message within 'git submodule add' John Szakmeister
@ 2011-07-23 11:59 ` John Szakmeister
  0 siblings, 0 replies; 2+ messages in thread
From: John Szakmeister @ 2011-07-23 11:59 UTC (permalink / raw)
  To: git; +Cc: John Szakmeister

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:
> 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
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-23 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-23 11:17 [PATCH] Stop hiding the error message within 'git submodule add' John Szakmeister
2011-07-23 11:59 ` John Szakmeister

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).