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

Get rid of refreshing cache after "git commit"?

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Jan 17, 2010, 08:16 UTC
Message-ID
<fcaeb9bf1001170016q5e285201r36f6030579cfa605@mail.gmail.com>
Hi,

The current "git commit" refreshes cache and writes out after a commit. I dug back in history to see how it was introduced. It looks like from the very first days of "git commit", which was git-commit-script at that time, git-update-cache was called on specified paths, until commit 22cff6a (git-commit: pass explicit path to git-diff-files. - 2005-08-16) started to do "git-update-cache -q --refresh" without paths and the tradition keeps going until today.

Nowadays almost (all?) porcelain commands silently refresh index before doing anything relating to worktree, I wonder if this tradition is still necessary. On (again) gentoo-x86 repository, taking out the refresh part could cut down about 1 sec on total 3 secs from "git commit -m foo".

-- 
Duy
Next: Junio C Hamano
Message 1 of 2 in “Get rid of refreshing cache after "git commit"?”
  1. Nguyen Thai Ngoc DuyJan 17, 2010
  2. Junio C HamanoJan 17, 2010

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.