git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] doc: clarify post-receive hook behavior

From
Justin Tobler <jltobler@gmail.com>
Date
Jul 14, 2024, 18:54 UTC
Message-ID
<zftb6xcmweatgzmhl44k3z5f7ga3wt64eryen3pvgbb6dpqaae@74h5fz3ffo5q>
In-Reply-To
<xmqq8qy6jjdc.fsf@gitster.g>
On 24/07/12 04:11PM, Junio C Hamano wrote:
Show 8 quoted lines
> Justin Tobler <jltobler@gmail.com> writes:
> 
> > -This hook executes once for the receive operation.  
> > +For a receive operation, this hook executes a single time at most.  
> 
> Hmph, maybe we can strike this sentence as we already said "once" in
> the previous paragraph.  The intention of the original description
> that said "only after" was to convey two things:
Ya, I competely agree that this is repetetive and should be removed. 
Show 18 quoted lines
> 
>  (1) it runs only once, and
>  (2) it does not run before all the ref-update requests have been
>      processed (either successfully or unsuccessfully).  
> 
> If the "only after" was not serving the original purpose of
> conveying both of the two, then perhaps we should remove the word
> "once" from the previous paragraph instead and keep this sentence.
> 
> My preference is revert your "once after" -> "once if" to get back
> to the original "once after", and then remove "this hook executes
> once for the receive operaiton" of the original, without adding your
> "For a receieve ... at most".
> 
>     The hook executes on the remote repository once after all the
>     proposed ref updates are processed and if at least one ref is
>     updated as the result.
> 

Thanks for the suggestion. This more clearly conveys the two points mentioned. Will add in V2.

Show 18 quoted lines
> > -It takes no
> > -arguments, but gets the same information as the
> > -<<pre-receive,'pre-receive'>>
> > -hook does on its standard input.
> > -It
> > +takes no arguments, but for each ref successfully updated, it receives a
> > +line on standard input that follows the same format as the
> > +<<pre-receive,'pre-receive'>> hook.
> 
> This part of the update is great.  The "but" there is annoying, but
> that badness was inherited from the original and not a fault of this
> patch.  If I were writing it from scratch I would probably have said
> something like:
> 
>     The hook takes no arguments.  It receives one line on standard
>     input for each ref that is successfully updated in the same
>     format as the pre-receive hook.
> 

I also agree that it is better to break out these two statements. Will adapt this for V2. Thanks again.

-Justin
Previous: Junio C HamanoNext: Justin Tobler
Message 3 of 8 in “doc: clarify post-receive hook behavior”
  1. doc: clarify post-receive hook behaviorJustin Tobler, Jul 12, 2024
  2. Junio C HamanoJul 12, 2024
  3. Justin ToblerJul 14, 2024
  4. doc: clarify post-receive hook behaviorJustin Tobler, Jul 14, 2024
  5. Junio C HamanoJul 15, 2024
  6. Justin ToblerJul 15, 2024
  7. Junio C HamanoJul 15, 2024
  8. doc: clarify post-receive hook behaviorJustin Tobler, Jul 15, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.