git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: git@vger.kernel.org, "Shawn O . Pearce" <spearce@spearce.org>
Subject: Re: [PATCH v2 2/2] receive-pack: detect aliased updates which can occur with symrefs
Date: Mon, 19 Apr 2010 13:39:32 -0700	[thread overview]
Message-ID: <7veiibqirf.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1271695179-32131-1-git-send-email-jaysoffian@gmail.com> (Jay Soffian's message of "Mon\, 19 Apr 2010 12\:39\:39 -0400")

Jay Soffian <jaysoffian@gmail.com> writes:

> @@ -503,9 +562,11 @@ static void execute_commands(struct command *commands, const char *unpacker_erro
>  		return;
>  	}
>  
> +	check_aliased_updates(commands);
> +
>  	head_name = resolve_ref("HEAD", sha1, 0, NULL);
>  
> -	for (cmd = commands; cmd; cmd = cmd->next)
> +	for (cmd = commands; cmd && !cmd->skip_update; cmd = cmd->next)
>  		cmd->error_string = update(cmd);
>  }

Do you really mean to have "skip-update" check as the loop termination
condition like this (i.e. "upon seeing any skip-update, abandon the rest
of the update queue"), or is this a typo of "skip this entry but keep
going, processing the rest" that should have been a separate "if" in the
body of the loop?

> @@ -545,6 +606,7 @@ static struct command *read_head_info(void)
>  		hashcpy(cmd->old_sha1, old_sha1);
>  		hashcpy(cmd->new_sha1, new_sha1);
>  		memcpy(cmd->ref_name, line + 82, len - 81);
> +		cmd->skip_update = 0;
>  		cmd->error_string = NULL;
>  		cmd->next = NULL;

It would make sense to do xcalloc(nmemb, size) of one member of that
length to allocate cmd at this point, instead of adding yet another
assignment like this.

It also would help me a slight bit if you compared what has been queued
with what you sent to catch minor differences between my expectation from
this series and what you have (e.g. I'd like to keep this as a fix that is
back-mergeable to 'maint' and also I have already done some style fixes to
the test).

Thanks.

  reply	other threads:[~2010-04-19 20:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 16:25 [PATCH v2 1/2] receive-pack: switch global variable 'commands' to a parameter Jay Soffian
2010-04-19 16:25 ` [PATCH v2 2/2] receive-pack: detect aliased updates which can occur with symrefs Jay Soffian
2010-04-19 16:31   ` Jay Soffian
2010-04-19 16:39   ` Jay Soffian
2010-04-19 20:39     ` Junio C Hamano [this message]
2010-04-19 20:57       ` Jay Soffian
2010-04-19 22:08   ` [PATCH v3 0/3] js/maint-receive-pack-symref-alias Jay Soffian
2012-12-11 19:46     ` [RFC/PATCH] ignoring a fetch that overwrites local symref Junio C Hamano
2012-12-11 22:32       ` [PATCH] fetch: ignore wildcarded refspecs that update local symbolic refs Junio C Hamano
2012-12-12 17:17         ` Jay Soffian
2012-12-12 19:13       ` [RFC/PATCH] ignoring a fetch that overwrites local symref Shawn Pearce
2012-12-12 19:38         ` Junio C Hamano
2010-04-19 22:08   ` [PATCH v3 1/3] receive-pack: switch global variable 'commands' to a parameter Jay Soffian
2010-04-19 22:08   ` [PATCH v3 2/3] t5516-fetch-push.sh: style cleanup Jay Soffian
2010-04-19 22:08   ` [PATCH v3 3/3] receive-pack: detect aliased updates which can occur with symrefs Jay Soffian
2010-04-19 22:19   ` Jay Soffian
2010-06-10 18:06     ` Ævar Arnfjörð Bjarmason

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7veiibqirf.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=spearce@spearce.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).