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

RE: [PATCH] git-submodule: Try harder to describe the status of a submodule

From
MEMedve Emilian-EMMEDVE1 <emilian.medve@freescale.com>
Date
Jul 2, 2007, 15:44 UTC
Message-ID
<598D5675D34BE349929AF5EDE9B03E27011D03ED@az33exm24.fsl.freescale.net>
In-Reply-To
<598D5675D34BE349929AF5EDE9B03E27011CFFED@az33exm24.fsl.freescale.net>
Hello Junio,

I noticed the 1.5.2.3 tag and the plans for 1.5.3-rc1 and I was wondering when do you think you'll apply your submodule patch? Is there any way I can help with it?

Thanks, Emil.

This e-mail, and any associated attachments have been classified as: -------------------------------------------------------------------- [x] Public [ ] Freescale Semiconductor Internal Use Only [ ] Freescale Semiconductor Confidential Proprietary

-----Original Message-----
From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
Behalf Of Medve Emilian-EMMEDVE1
Sent: Thursday, June 28, 2007 8:01 AM
To: git@vger.kernel.org
Subject: RE: [PATCH] git-submodule: Try harder to describe the status of
a submodule
Hello Junio,
Alright, let's go with your patch.

Cheers, Emil.

This e-mail, and any associated attachments have been classified as: -------------------------------------------------------------------- [x] Public [ ] Freescale Semiconductor Internal Use Only [ ] Freescale Semiconductor Confidential Proprietary

-----Original Message-----
From: Junio C Hamano [mailto:gitster@pobox.com] 
Sent: Wednesday, June 27, 2007 11:25 PM
To: Medve Emilian-EMMEDVE1
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-submodule: Try harder to describe the status of
a submodule
Emil Medve <Emilian.Medve@Freescale.com> writes:
> Some repositories might not use/have annotated tags (for example
repositories created with
> git-cvsimport) or might not have tags at all and could cause
git-submodule status to fail because
> git-describe might fail.
>
> This change makes git-submodule status try harder in displaying the
status of a module by
> considering lightweight tags, subsequent tags and branches.
Why are we suddenly seeing these loooooooong lines...
> +get_revname()
> +{
> +	_revname=$(git-describe --tags "$1" 2>/dev/null || git-describe
--contains "$1" 2>/dev/null)
> +	if test -z "$_revname" -o "$_revname" = "undefined"
> +	then
> +		_revname=$(git-describe --all "$1" 2>/dev/null | cut -d
/ -f2-)
> +		test -z "$_revname" && _revname=undefined
> +	fi

I really do not think using --all is useful. If you do not have a tag and the rev cannot be described, what damage does it incur?

We still say "$sha1 $path" in the output anyway, and ($revname) is only "it makes it nicer" appendix.

Show 5 quoted lines
> @@ -155,7 +174,7 @@ modules_list()
>  			say "-$sha1 $path"
>  			continue;
>  		fi
> -		revname=$(unset GIT_DIR && cd "$path" && git-describe
$sha1)
> +		revname=$(unset GIT_DIR && cd "$path" && get_revname
$sha1)
>  		if git diff-files --quiet -- "$path"
>  		then
>  			say " $sha1 $path ($revname)"

In that sense, I would prefer mine much better. If a rev is indescribable, your version would say:

	" dddddddddddddddddddddddddddddddddddddddd subdir (undefined)"
while mine would have said:
	" dddddddddddddddddddddddddddddddddddddddd subdir"
Previous: Medve Emilian-EMMEDVE1
Message 4 of 4 in “git-submodule: Try harder to describe the status of a submodule”
  1. git-submodule: Try harder to describe the status of a submoduleEmil Medve, Jun 27, 2007
  2. Junio C HamanoJun 28, 2007
  3. Medve Emilian-EMMEDVE1Jun 28, 2007
  4. Medve Emilian-EMMEDVE1Jul 2, 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.