git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: marcnarc@xiplink.com
Cc: Jens Lehmann <Jens.Lehmann@web.de>, git@vger.kernel.org
Subject: Re: [PATCH] fetch: Only call a new ref a "branch" if it's under refs/heads/.
Date: Thu, 12 Apr 2012 01:52:17 -0400	[thread overview]
Message-ID: <20120412055216.GC27369@sigill.intra.peff.net> (raw)
In-Reply-To: <1334154569-26124-1-git-send-email-marcnarc@xiplink.com>

On Wed, Apr 11, 2012 at 10:29:29AM -0400, marcnarc@xiplink.com wrote:

>  builtin/fetch.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 65f5f9b..57be58a 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -298,8 +298,13 @@ static int update_local_ref(struct ref *ref,
>  			what = _("[new tag]");
>  		}
>  		else {
> -			msg = "storing head";
> -			what = _("[new branch]");
> +			if (!prefixcmp(ref->name, "refs/heads/")) {
> +				msg = "storing head";
> +				what = _("[new branch]");
> +			} else {
> +				msg = "storing ref";
> +				what = _("[new ref]");
> +			}
>  			if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
>  			    (recurse_submodules != RECURSE_SUBMODULES_ON))
>  				check_for_new_submodule_commits(ref->new_sha1);

It looks like you kept the behavior the same with respect to
recurse_submodules, which will continue to run for everything except
tags. Which is probably a good choice, since your patch only wanted to
deal with the status message, but I am left to wonder: if submodules
were intended to be recursed for branches but not tags, what should
happen for other types of refs? Was it intentional that they fell into
the "branch" category here, or were they following the same failure to
distinguish that the message-writing code had?

This code block handles only new refs.  If you look at the code below,
updates of existing refs (forced or not) will happen for all refs,
including tags.

Jens, can you double-check the intended logic?

-Peff

  reply	other threads:[~2012-04-12  5:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 14:29 [PATCH] fetch: Only call a new ref a "branch" if it's under refs/heads/ marcnarc
2012-04-12  5:52 ` Jeff King [this message]
2012-04-12 20:15   ` Jens Lehmann
2012-04-12 20:36     ` Marc Branchaud
2012-04-12 20:42       ` Jens Lehmann
2012-04-12 21:05         ` Jeff King
2012-04-13  7:04           ` Jeff King
2012-04-13 16:25             ` [PATCH] submodules: recursive fetch also checks new tags for submodule commits Jens Lehmann

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120412055216.GC27369@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=marcnarc@xiplink.com \
    /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.
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).