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

Re: Adding a new file as if it had existed

From
APAndy Parkins <andyparkins@gmail.com>
Date
Dec 12, 2006, 12:26 UTC
Message-ID
<200612121226.32772.andyparkins@gmail.com>
In-Reply-To
<7ac1e90c0612120332o20d6778bsa16a788fdc04a3a1@mail.gmail.com>
On Tuesday 2006 December 12 11:32, Bahadir Balban wrote:
Show 5 quoted lines
> If I don't know which files I may be touching in the future for
> implementing some feature, then I am obliged to add all the files even
> if they are irrelevant. I said "performance reasons" assuming all the
> file hashes need checked for every commit -a to see if they're
> changed, but I just tried on a PIII and it seems not so slow.
Here's a handy rule of thumb I've learned in my use of git:
 "git is fast.  Really fast."

That'll hold you in good stead. In my experience there is no operation in git that is slow. I've got some trees that are for embedded work and hold the whole linux kernel, often more than once. Subversion, which I used previously, took literally hours to import the whole tree. Git takes minutes.

As to your direct concern: git doesn't hash every file at every commit. There is no need. git has an "index" that is used to prepare a commit; at the time you do the actual commit, git already knows which files are being checked in. Obviously, Linus uses git for managing the linux kernel, he's said before that he wanted a version control system that can do multiple commits /per second/. git can do that.

In short - don't worry about making life easy for git - it's a workhorse and does a grand job.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
Previous: Johannes SchindelinNext: Andreas Ericsson
Message 5 of 11 in “Adding a new file as if it had existed”
  1. Bahadir BalbanDec 12, 2006
  2. Junio C HamanoDec 12, 2006
  3. Bahadir BalbanDec 12, 2006
  4. Johannes SchindelinDec 12, 2006
  5. Andy ParkinsDec 12, 2006
  6. Andreas EricssonDec 12, 2006
  7. Junio C HamanoDec 12, 2006
  8. Andreas EricssonDec 13, 2006
  9. Johannes SchindelinDec 13, 2006
  10. Andreas EricssonDec 13, 2006
  11. Jakub NarebskiDec 12, 2006

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.