All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Max Horn <max@quendi.de>, Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Felipe Contreras <felipe.contreras@gmail.com>
Subject: Re: What's cooking in git.git (Feb 2014, #06; Wed, 19)
Date: Fri, 21 Feb 2014 16:46:29 +0100	[thread overview]
Message-ID: <530774D5.8040101@web.de> (raw)
In-Reply-To: <FB0B19C8-65BF-49CF-8EE4-5B9D55BBCE7C@quendi.de>

On 2014-02-21 10.55, Max Horn wrote:
> 
> On 20.02.2014, at 20:22, Junio C Hamano <gitster@pobox.com> wrote:
> 
>> Max Horn <max@quendi.de> writes:
>>
>>> On 19.02.2014, at 22:41, Junio C Hamano <gitster@pobox.com> wrote:
>>>
>>>> * fc/transport-helper-fixes (2013-12-09) 6 commits
>>>> - remote-bzr: support the new 'force' option
>>>> - test-hg.sh: tests are now expected to pass
>>>> - transport-helper: check for 'forced update' message
>>>> - transport-helper: add 'force' to 'export' helpers
>>>> - transport-helper: don't update refs in dry-run
>>>> - transport-helper: mismerge fix
>>>>
>>>> Reported to break t5541, and has been stalled for a while without
>>>> fixes.
>>> ...
>>> Since I somewhat care about transport-helpers, I had a closer look
>>> at this failure.
>>
>> Thanks.  Let's keep it a bit longer and see how your new
>> investigation (and possibly help from others) develops to a
>> solution.
> 
> So I had a closer look, and I now believe to now understand what the right fix is. Simply dropping 
>   transport-helper: check for 'forced update' message
> would be wrong, because it would cause the contrib/remote-helpers test cases to fail -- when I tested last night, I forgot that I had to run those separately. Silly me!
> 
> Indeed, these tests include a test with a force push, and trigger the code path added in that commit. The remaining problem then is that the new code should be changed to only tell git when a remote-helper signals a forced update; but it should not incorrectly reset the forced_update flag to 0 if git already considers the update to be forced.
> 
> In other words, the following patch should be the correct solution, as far as I can tell. I verified that it fixes t5541 and causes no regressions in the contrib/remote-helpers test suite.
> 
> -- 8< --
> diff --git a/transport-helper.c b/transport-helper.c
> index fa7c608..86e1679 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -734,7 +734,7 @@ static int push_update_ref_status(struct strbuf *buf,
>         }
> 
>         (*ref)->status = status;
> -       (*ref)->forced_update = forced;
> +       (*ref)->forced_update |= forced;
>         (*ref)->remote_status = msg;
>         return !(status == REF_STATUS_OK);
>  }
> -- 8< --
> 
> 
Ack from my side:

There are 2 fields:
ref->force and ref->forced_update.

forced_update is set in set_ref_status_for_push() in remote.c:

		if (!force_ref_update)
			ref->status = reject_reason;
		else if (reject_reason)
			ref->forced_update = 1;
		}
And transport-helper.c sets it to 0 even if it had been 1, which is wrong.

  reply	other threads:[~2014-02-21 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 21:41 What's cooking in git.git (Feb 2014, #06; Wed, 19) Junio C Hamano
2014-02-20 18:39 ` Max Horn
2014-02-20 19:22   ` Junio C Hamano
2014-02-21  9:55     ` Max Horn
2014-02-21 15:46       ` Torsten Bögershausen [this message]
2014-02-21 18:04       ` Junio C Hamano
2014-02-22  0:55         ` Max Horn
2014-02-24 16:57           ` Junio C Hamano
2014-02-24 17:06             ` Junio C Hamano
2014-02-24 17:55               ` Max Horn
2014-02-21 16:18 ` Ramkumar Ramachandra

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=530774D5.8040101@web.de \
    --to=tboegi@web.de \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=max@quendi.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.