From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Steven Grimm <koreth@midwinter.com>, git@vger.kernel.org
Subject: Re: [PATCH v3] Allow update hooks to update refs on their own
Date: Wed, 28 Nov 2007 15:42:03 -0800 [thread overview]
Message-ID: <7vve7m0wfo.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20071128230355.GB13964@coredump.intra.peff.net> (Jeff King's message of "Wed, 28 Nov 2007 18:03:55 -0500")
Jeff King <peff@peff.net> writes:
> On Wed, Nov 28, 2007 at 02:14:03PM -0800, Steven Grimm wrote:
>
>> @@ -177,7 +179,16 @@ static int receive_status(int in, struct ref *refs)
>>
>> line[strlen(line)-1] = '\0';
>> refname = line + 3;
>> - msg = strchr(refname, ' ');
>> + newsha1_hex = strchr(refname, ' ');
>> + if (newsha1_hex) {
>> + *newsha1_hex++ = '\0';
>> + if (get_sha1_hex(newsha1_hex, newsha1)) {
>> + fprintf(stderr, "protocol error: bad sha1 %s\n",
>> + newsha1_hex);
>> + newsha1_hex = NULL;
>> + }
>> + }
>> + msg = strchr(newsha1_hex, ' ');
>> if (msg)
>> *msg++ = '\0';
>
> Doesn't this always put the first "word" of a response into newsha1_hex?
> We want to do this only for 'ok' responses; 'ng' responses are already
> using that space as part of the error message.
I do not think reporting back the rewritten object name makes much sense
nor adds any value; it won't be useful information until you fetch the
object.
I do not think reporting back _anything_ other than "ok" adds much value
at all. Sure, if the update hook did something funky you would get such
a report, but the situation is not any different if some warm body is
sitting on the other end and building on top of what you pushed
immediately he sees any push into the repository, and in such a case
your git-push would not get any such reporting anyway.
We do not even have to worry about this reporting at all if we do not
allow munging the refs in the update hook. In a sense, this patch is
creating a problem that does not need to be solved. Perhaps modifying
update hook to allow so makes it possible to munge refs while holding a
lock, but is it really worth this hassle? Isn't there a better way, I
wonder?
next prev parent reply other threads:[~2007-11-28 23:42 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-27 21:17 [PATCH] Allow update hooks to update refs on their own Steven Grimm
2007-11-27 21:21 ` Jakub Narebski
2007-11-27 21:23 ` Steven Grimm
2007-11-28 1:19 ` Junio C Hamano
2007-11-28 2:40 ` Steven Grimm
2007-11-28 3:25 ` Daniel Barkalow
2007-11-28 3:49 ` Junio C Hamano
2007-11-28 5:20 ` Steven Grimm
2007-11-28 16:10 ` Jeff King
2007-11-28 19:00 ` Junio C Hamano
2007-11-28 19:41 ` Steven Grimm
2007-11-28 19:49 ` Jeff King
2007-11-28 20:16 ` Steven Grimm
2007-11-28 20:22 ` Jeff King
2007-11-28 22:01 ` Junio C Hamano
2007-11-28 22:14 ` [PATCH v3] " Steven Grimm
2007-11-28 23:03 ` Jeff King
2007-11-28 23:42 ` Junio C Hamano [this message]
2007-11-29 6:44 ` Steven Grimm
2007-11-30 1:06 ` Junio C Hamano
2007-12-02 21:22 ` [PATCH v4] " Steven Grimm
2007-12-02 21:56 ` Junio C Hamano
2007-12-03 2:13 ` Jeff King
2007-12-03 2:16 ` Junio C Hamano
2007-12-03 3:45 ` Junio C Hamano
2007-12-05 22:14 ` Steven Grimm
2007-12-05 22:19 ` Junio C Hamano
2007-12-05 22:29 ` Junio C Hamano
2007-12-06 5:57 ` Jeff King
2007-12-06 6:30 ` Junio C Hamano
2007-12-06 6:36 ` Jeff King
2007-12-06 7:50 ` Steven Grimm
2007-12-03 4:01 ` Shawn O. Pearce
2007-12-03 5:25 ` Junio C Hamano
2007-12-04 1:55 ` Shawn O. Pearce
2007-12-03 11:47 ` Johannes Schindelin
2007-12-04 1:51 ` Shawn O. Pearce
2007-12-04 2:12 ` Johannes Schindelin
2007-12-04 2:20 ` Shawn O. Pearce
2007-12-04 2:25 ` Johannes Schindelin
2007-12-04 2:33 ` Steven Grimm
2007-12-04 2:34 ` Shawn O. Pearce
2007-11-28 21:49 ` [PATCH] " Junio C Hamano
2007-11-28 22:37 ` Jeff King
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=7vve7m0wfo.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=koreth@midwinter.com \
--cc=peff@peff.net \
/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).