git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Ilari Liusvaara <ilari.liusvaara@elisanet.fi>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	Elijah Newren <newren@gmail.com>,
	Thiago Farina <tfransosi@gmail.com>
Subject: Re: [PATCH v6 p2 3/9] transport-helper: trivial code shuffle
Date: Wed, 28 Nov 2012 01:05:34 +0100	[thread overview]
Message-ID: <CAMP44s0fmt+bHN-ycza8b+y8Ep-Cyqmg1U1PVas267fTY5iPPQ@mail.gmail.com> (raw)
In-Reply-To: <7vk3t7nfql.fsf@alter.siamese.dyndns.org>

On Tue, Nov 27, 2012 at 6:00 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> Just shuffle the die() part to make it more explicit, and cleanup the
>> code-style.
>>
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>> ---
>>  transport-helper.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/transport-helper.c b/transport-helper.c
>> index 32ad877..0c95101 100644
>> --- a/transport-helper.c
>> +++ b/transport-helper.c
>> @@ -775,6 +775,9 @@ static int push_refs_with_export(struct transport *transport,
>>               char *private;
>>               unsigned char sha1[20];
>>
>> +             if (ref->deletion)
>> +                     die("remote-helpers do not support ref deletion");
>> +
>>               if (!data->refspecs)
>>                       continue;
>
> This is not just "just shuffle the die to make it explicit" but it
> does change the semantics; earlier ref->deletion was perfectly fine
> as long as data->refspecs is not given, but the new code always
> dies.
>
> If this semantic change is a good thing, please explain why it is so
> in the log message.  If the change is "it does not matter because
> when data->refspecs is not given and ref->deletion is set, we die
> later elsewhere in the code anyway", then it needs to be described.

refspecs are optional, but when they are not present the code doesn't
work at all. This patch changes the behavior that was totally broken
anyway.

-- 
Felipe Contreras

  reply	other threads:[~2012-11-28  0:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-24  3:25 [PATCH v6 p2 0/9] transport-helper and fast-export fixes Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 1/9] transport-helper: update remote helper namespace Felipe Contreras
2012-11-24  3:28   ` Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 2/9] fast-export: don't handle uninteresting refs Felipe Contreras
2012-11-24  3:27   ` Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 3/9] transport-helper: trivial code shuffle Felipe Contreras
2012-11-27 17:00   ` Junio C Hamano
2012-11-28  0:05     ` Felipe Contreras [this message]
2012-11-28  1:54       ` Junio C Hamano
2012-11-28  2:15         ` Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 4/9] transport-helper: fix push without refspec Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 5/9] transport-helper: fix pushing with straight refspec Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 6/9] transport-helper: fix push without marks Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 7/9] fast-export: make extra_refs global Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 8/9] fast-export: refactor get_tags_and_duplicates() Felipe Contreras
2012-11-24  3:25 ` [PATCH v6 p2 9/9] fast-export: trivial cleanups Felipe Contreras

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=CAMP44s0fmt+bHN-ycza8b+y8Ep-Cyqmg1U1PVas267fTY5iPPQ@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ilari.liusvaara@elisanet.fi \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    --cc=srabbelier@gmail.com \
    --cc=tfransosi@gmail.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.
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).