{"thread":{"id":"6354","subject":"Re: Importing from tarballs; add, rm, update-index?","startedAt":"2007-01-12T14:09:09Z","lastAt":"2007-01-12T14:39:56Z","messageCount":2,"participants":["Horst H. von Brand","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"31555","messageId":"200701121409.l0CE9923015123@laptop13.inf.utfsm.cl","threadId":"6354","inReplyTo":"riddochc@gmail.com","subject":"Re: Importing from tarballs; add, rm, update-index?","fromName":"Horst H. von Brand","fromEmail":"vonbrand@inf.utfsm.cl","sentAt":"2007-01-12T14:09:09Z","receivedAt":"2007-01-12T14:09:09Z","isPatch":false,"sender":{"key":"vonbrand@inf.utfsm.cl","avatar":"https://avatars.githubusercontent.com/u/211384?v=4"},"body":"Chris Riddoch <riddochc@gmail.com> wrote:\n> I've got a very, very old codebase I'm trying to wrap my head around.\n> It was apparently once tracked with RCS, but the ,v files are long\n> gone and all that remains are a series of tarballs on an FTP site\n> containing alpha, beta, and final releases of various versions of the\n> project.  There's a logical progression, but between each there are\n> new files, deleted files, and lots of changed files.  gitk will at\n> least help me make sense of the actual changes.  I've got part of a\n> shell script to automate this process.\n> \n> Here's the problem.\n> \n> I have tried to follow the debate on git add, rm, commit -a, etc.  But\n> I can't figure out how to simply say, take the full state of the\n> working directory, and make the index directly reflect that state.\n> Additions, removals, and differences alike.  One step, preferably.\n\nHum... something like the following (completely untested!) should do the\ntrick:\n\n  cd /basedir\n  mkdir codebase; cd codebase; git init-db\n  for version in 1.0 1.1 1.1a 1.1b 2.0.0 ...; do\n     cd /basedir\n     tar xf tarball-$version.tar\n     mv codebase-$version/* codebase    # Take care to move everything!\n     cd codebase\n     git add .\n     git commit -a -m \"Updated to $version\"\n     rm -rf *                  # Delete everything except for git stuff\n  done\n\nFiles that don't change will be recorded as is (git tracks contents).\n    \nComments?\n-- \nDr. Horst H. von Brand                   User #22616 counter.li.org\nDepartamento de Informatica                    Fono: +56 32 2654431\nUniversidad Tecnica Federico Santa Maria             +56 32 2654239\nCasilla 110-V, Valparaiso, Chile               Fax:  +56 32 2797513\n"},{"id":"31557","messageId":"45A79DBC.1795F5C4@eudaptics.com","threadId":"6354","inReplyTo":"200701121409.l0CE9923015123@laptop13.inf.utfsm.cl","subject":"Re: Importing from tarballs; add, rm, update-index?","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-01-12T14:39:56Z","receivedAt":"2007-01-12T14:39:56Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"\"Horst H. von Brand\" wrote:\n> Hum... something like the following (completely untested!) should do the\n> trick:\n> \n>   cd /basedir\n>   mkdir codebase; cd codebase; git init-db\n>   for version in 1.0 1.1 1.1a 1.1b 2.0.0 ...; do\n>      cd /basedir\n>      tar xf tarball-$version.tar\n>      mv codebase-$version/* codebase    # Take care to move everything!\n>      cd codebase\n>      git add .\n>      git commit -a -m \"Updated to $version\"\n>      rm -rf *                  # Delete everything except for git stuff\n>   done\n\nYou can let GIT_DIR point somewhere outside the extracted directory.\n\nIf the dates of your tarballs are meaningful, you can use something like\nthis:\n\nexport GIT_AUTHOR_DATE=\"$(date --reference=foo-1.1.tar +%s) -07:00\"\n\n   \n-- Hannes\n"}]}