Re: Efficient way to import snapshots?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ Junio added, because I think I noticed a performance bug ]

On Mon, 30 Jul 2007, Craig Boston wrote:
> 
> A couple questions on that:
> 
> 1. Will it notice deleted files?

Yes, although I think you need to do "git commit -a" for that. 

"git add ." could (and perhaps _should_) notice them and remove them from 
the cache, but doesn't. Whether that's the right behaviour or not (it does 
seem a bit strange that "git add" would actually remove files from the 
index too) is up for debate.

But with "git commit -a", it will be noticed at commit time, at least.

That said, I just noticed something nasty: "git add ." is *horrible*. It 
does the full SHA1 re-computation even though the index is up-to-date. 
That's really nasty.

So right now, due to this performance bug, it's actually much better to do 
something more complex, namely something like

	git ls-files -o | git update-index --add --stdin
	git commit -a

which is a lot more efficient than just doing "git add .".

Junio? I _thought_ we already took the index into account with "git add", 
but we obviously don't. 

> 2. How can I tell it what branch to commit to?

Whatever branch is checked out in the GIT_DIR will be the one that it 
commits to.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux