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

Re: Efficient way to import snapshots?

From
CBCraig Boston <craig@olyun.gank.org>
Date
Jul 30, 2007, 19:29 UTC
Message-ID
<20070730192922.GB64467@nowhere>
In-Reply-To
<alpine.LFD.0.999.0707301144180.4161@woody.linux-foundation.org>
On Mon, Jul 30, 2007 at 11:56:56AM -0700, Linus Torvalds wrote:
Show 6 quoted lines
> It should literally be as easy as doing something like
> 
> 	cd /path/to/cvs/checkout_X
> 	export GIT_DIR=/path/to/git/repo
> 	git add .
> 	git commit -m"Import yyyymmdd snapshot"

Aha! I didn't know that you could point to a repository with GIT_DIR and do useful operations without a working directory. My "master" repo that gets backed up and cloned everywhere is a bare repo anyway; I had been cloning it with -s and then using 'git push' to get changes back into it.

A couple questions on that:
1. Will it notice deleted files?
2. How can I tell it what branch to commit to?
Show 5 quoted lines
> You'd have to make sure that you have the CVS directories ignored, of 
> course, and if you don't want to change the CVS directory at all (which is 
> a good idea!) you'd need to do that by using the "ignore" file in your 
> GIT_DIR, and just having the CVS entry there, instead of adding a
> ".gitignore" file to the working tree and checking it in.

Not a problem, I'm using cvsup in checkout mode so there are no CVS dirs. The checkout directory is an exact snapshot of "What The Repository Should Look Like."

Show 5 quoted lines
> The above is totally untested, of course, but I think that's the easiest 
> way to do things like this. In general, it should be *trivial* to do 
> snapshots with git using just about _any_ legacy SCM, exactly because you 
> can keep the whole git setup away from the legacy SCM directories with 
> that "GIT_DIR=.." thing. 
I'll make a backup of my repo and give it a try.
Thanks!
Craig
Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 27 in “Efficient way to import snapshots?”
  1. Craig BostonJul 30, 2007
  2. Linus TorvaldsJul 30, 2007
  3. Craig BostonJul 30, 2007
  4. Linus TorvaldsJul 30, 2007
  5. Craig BostonJul 30, 2007
  6. Junio C HamanoJul 30, 2007
  7. Craig BostonJul 30, 2007
  8. Junio C HamanoJul 30, 2007
  9. Linus TorvaldsJul 30, 2007
  10. Junio C HamanoJul 30, 2007
  11. Linus TorvaldsJul 30, 2007
  12. Junio C HamanoJul 30, 2007
  13. Linus TorvaldsJul 31, 2007
  14. Junio C HamanoJul 31, 2007
  15. Craig BostonJul 30, 2007
  16. Linus TorvaldsJul 30, 2007
  17. Craig BostonJul 31, 2007
  18. Linus TorvaldsJul 31, 2007
  19. Theodore TsoJul 31, 2007
  20. Craig BostonJul 31, 2007
  21. Linus TorvaldsJul 31, 2007
  22. Theodore TsoJul 31, 2007
  23. David KastrupJul 31, 2007
  24. Florian WeimerJul 31, 2007
  25. David KastrupJul 31, 2007
  26. Jakub NarebskiJul 30, 2007
  27. David KastrupJul 30, 2007

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.