threads / discuss / 6355

Re: Importing from tarballs; add, rm, update-index?

Subject: Re: Importing from tarballs; add, rm, update-index?

## tl;dr

One message between Jan 12, 2007 and Jan 12, 2007.

replies: 0people: 1as markdown or json

Horst H. von Brand· Jan 12, 2007, 15:39 UTC · lore
Johannes Sixt <J.Sixt@eudaptics.com> wrote:
Show 17 quoted lines
> "Horst H. von Brand" wrote:
> > Hum... something like the following (completely untested!) should do the
> > trick:
> > 
> >   cd /basedir
> >   mkdir codebase; cd codebase; git init-db
> >   for version in 1.0 1.1 1.1a 1.1b 2.0.0 ...; do
> >      cd /basedir
> >      tar xf tarball-$version.tar
> >      mv codebase-$version/* codebase    # Take care to move everything!
> >      cd codebase
> >      git add .
> >      git commit -a -m "Updated to $version"
> >      rm -rf *                  # Delete everything except for git stuff
> >   done
> 
> You can let GIT_DIR point somewhere outside the extracted directory.
OK! Then it would be:
   cd /basedir
   mkdir codebase/.git; cd codebase; git init-db
   for version in 1.0 1.1 1.1a 1.1b 2.0.0 ...; do
      cd /basedir
      tar xf tarball-$version.tar
      cd codebase-$version
      git --git-dir=/basedir/codebase/.git add .
      git --git-dir=/basedir/codebase/.git \
          commit -a -m "Updated to $version"    # Spice up to taste
   done
And the "add" looks strangely misplaced... but it /does/ its job.
> If the dates of your tarballs are meaningful, you can use something like
> this:
> 
> export GIT_AUTHOR_DATE="$(date --reference=foo-1.1.tar +%s) -07:00"
Better use it to make up a commit message. Could use inline docs for this.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                    Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria             +56 32 2654239
Casilla 110-V, Valparaiso, Chile               Fax:  +56 32 2797513

← back to recent threads