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

Re: [PATCH] receive-pack: purge temporary data if no command is ready to run

From
Bojun Chen <bojun.cbj@gmail.com>
Date
Jan 25, 2022, 16:49 UTC
Message-ID
<CADuS7Aov-J4LjAm_e_DOHaAba9JHFFV-2trxBywzL4vtwuvr4Q@mail.gmail.com>
In-Reply-To
<xmqqk0eo1zhu.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2022年1月25日周二 07:32写道:
Show 14 quoted lines
>
> > +     /*
> > +      * If there is no command ready to run, should return directly to destroy
> > +      * temporary data in the quarantine area.
> > +      */
> > +     for (cmd = commands; cmd && cmd->error_string; cmd = cmd->next);
>
> Write the empty body of the loop like this:
>
>         for (...)
>                 ; /* nothing */
>
> to make it stand out.
>
Thanks for the suggestion, this is more readable.
Show 27 quoted lines
> > +     if (!cmd)
> > +             return;
> > +
>
> > -mk_empty () {
> > +mk_empty() {
> >       repo_name="$1"
> >       rm -fr "$repo_name" &&
> > -     mkdir "$repo_name" &&
> > -     (
> > -             cd "$repo_name" &&
> > -             git init &&
> > -             git config receive.denyCurrentBranch warn &&
> > -             mv .git/hooks .git/hooks-disabled
> > -     )
> > +             mkdir "$repo_name" &&
> > +             (
> > +                     cd "$repo_name" &&
> > +                             git init &&
> > +                             git config receive.denyCurrentBranch warn &&
> > +                             mv .git/hooks .git/hooks-disabled
> > +             )
> >  }
>
> Documentation/CodingGuidelines.  As far as I can tell, the above
> does not change anything the function does, and the only change in
> the patch is to violate the style guide badly.  Why?

Sorry. I'll roll back these formatting issues. Jiang Xin reminded me to look at this document, but I did miss an important part. At the same time, I used a wrong range-diff command in the review I sent internally earlier, which made my changes look like "mk_empty() {" to "mk_empty () {". So this problem was not detected in time.

Previous: Junio C HamanoNext: Jiang Xin
Message 5 of 18 in “receive-pack: purge temporary data if no command is ready to run”
  1. receive-pack: purge temporary data if no command is ready to runBoJun via GitGitGadget, Jan 24, 2022
  2. Ævar Arnfjörð BjarmasonJan 24, 2022
  3. Lertz ChenJan 25, 2022
  4. Junio C HamanoJan 24, 2022
  5. Bojun ChenJan 25, 2022
  6. Jiang XinJan 25, 2022
  7. receive-pack: purge temporary data if no command is ready to runChen BoJun, Jan 29, 2022
  8. Junio C HamanoFeb 1, 2022
  9. Junio C HamanoFeb 1, 2022
  10. Bojun ChenFeb 5, 2022
  11. Junio C HamanoFeb 5, 2022
  12. Jiang XinFeb 7, 2022
  13. Bojun ChenFeb 7, 2022
  14. Junio C HamanoFeb 4, 2022
  15. Bojun ChenFeb 5, 2022
  16. Junio C HamanoFeb 5, 2022
  17. 0/1 purge temporary data if no command is ready to runChen BoJun, Feb 7, 2022
  18. 1/1 receive-pack: purge temporary data if no command is ready to runChen BoJun, Feb 7, 2022

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.