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

Re: [PATCH v2 1/1] unpack-trees: exit check_updates() early if updates are not wanted

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 7, 2020, 16:37 UTC
Message-ID
<xmqq8smj6x3s.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<dd277273324eaba5e1f4a368bf2e4d046033c776.1578380277.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 12 quoted lines
> From: Elijah Newren <newren@gmail.com>
>
> check_updates() has a lot of code that repeatedly checks whether
> o->update or o->dry_run are set.  (Note that o->dry_run is a
> near-synonym for !o->update, but not quite as per commit 2c9078d05bf2
> ("unpack-trees: add the dry_run flag to unpack_trees_options",
> 2011-05-25).)  In fact, this function almost turns into a no-op whenever
> the condition
>    !o->update || o->dry_run
> is met.  Simplify the code by checking this condition at the beginning
> of the function, and when it is true, do the few things that are
> relevant and return early.
Thanks; will queue.
Previous: Elijah Newren via GitGitGadget
Message 7 of 7 in “unpack-trees: exit check_updates() early if updates are not wanted”
  1. 0/1 unpack-trees: exit check_updates() early if updates are not wantedElijah Newren via GitGitGadget, Jan 3, 2020
  2. 1/1 unpack-trees: exit check_updates() early if updates are not wantedElijah Newren via GitGitGadget, Jan 3, 2020
  3. Junio C HamanoJan 4, 2020
  4. Elijah NewrenJan 5, 2020
  5. 0/1 unpack-trees: exit check_updates() early if updates are not wantedElijah Newren via GitGitGadget, Jan 7, 2020
  6. 1/1 unpack-trees: exit check_updates() early if updates are not wantedElijah Newren via GitGitGadget, Jan 7, 2020
  7. Junio C HamanoJan 7, 2020

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.