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

Re: [PATCH 2/2] branch: drop unused worktrees variable

From
Jeff King <peff@peff.net>
Date
Jul 1, 2022, 18:24 UTC
Message-ID
<Yr87zb6TBTYlwCrw@coredump.intra.peff.net>
In-Reply-To
<220620.865ykvw2l4.gmgdl@evledraar.gmail.com>
On Mon, Jun 20, 2022 at 09:09:27PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 7 quoted lines
> I.e. if we had a "foo(worktrees)" line before the "worktrees =
> get_worktrees()" we'd still remove these lines, but we don't want
> that. It just needs to do the appropriate cocci for "don't match it if
> you see this variable, unless the line matches...".
> 
> Of coures that only helps after your 1/2, so maybe there's not much
> value in it for your case, i.e. it won't be reaching across functions.

The cases that reach across functions are actually easier to find, because the compiler knows that the function does not even look at its parameter. And so you can remove it, and then remove it from the caller, and so on.

Of course, that requires us to squash all of the -Wunused-parameter noise. I've done that, but it's like 100 ugly patches. I haven't had the time to polish it all up, but perhaps I'll at least send the start of the transition soon.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 5 of 7 in “extra cleanups on top of ds/branch-checked-out”
  1. 0/2 extra cleanups on top of ds/branch-checked-outJeff King, Jun 19, 2022
  2. 1/2 fetch: stop passing around unused worktrees variableJeff King, Jun 19, 2022
  3. 2/2 branch: drop unused worktrees variableJeff King, Jun 19, 2022
  4. Ævar Arnfjörð BjarmasonJun 20, 2022
  5. Jeff KingJul 1, 2022
  6. Junio C HamanoJun 21, 2022
  7. Derrick StoleeJun 19, 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.