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

Re: [PATCH] git-submodule: Error messages from 'git describe' shouldn't end up on the terminal

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 25, 2007, 23:09 UTC
Message-ID
<7vfy3ccc6y.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<11853733111502-git-send-email-Emilian.Medve@Freescale.com>
Emil Medve <Emilian.Medve@Freescale.com> writes:
Show 25 quoted lines
> As of now a failure to locate the closest tag to a commit (e.g because there is
> no tag in the repository) is handled explicitly by displaying an 'undefined' tag
> error message. However when git describe fails it will still display an
> undesirable  "fatal: cannot describe SHA1" message. This patch hides that
> message as git-submodule has an alternative and explicit error handling method
> in place for this situation
>
> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> ---
>  git-submodule.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 1f0cb99..3804f18 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -233,7 +233,7 @@ modules_list()
>  			say "-$sha1 $path"
>  			continue;
>  		fi
> -		revname=$(unset GIT_DIR && cd "$path" && git describe --tags $sha1)
> +		revname=$(unset GIT_DIR && cd "$path" && git describe --tags $sha1 2>/dev/null)
>  		set_name_rev "$path" "$sha1"
>  		if git diff-files --quiet -- "$path"
>  		then

It appears that set_name_rev does the moral equivalent of that line you touched but more elaborately, to set the same variable. Shouldn't we be simply removing that line instead?

Previous: Emil Medve
Message 2 of 2 in “git-submodule: Error messages from 'git describe' shouldn't end up on the terminal”
  1. git-submodule: Error messages from 'git describe' shouldn't end up on the terminalEmil Medve, Jul 25, 2007
  2. Junio C HamanoJul 25, 2007

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.