Re: git advice
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4e9UT==GKD9C8CAam4_injW5+1mY4T=J-Nkq0Z+-iRv9g@mail.gmail.com> |
2012/3/10 James K. Lowden <[email protected]>: > For an overnight tarball builder against > https://gitorious.org/freetds/freetds, what is the best way to get the > latest HEAD and branch code? > > Currently in CVS, I do: > > 1. cd $(TOPSRC) > 2. /bin/rm -rf .cvsignore * > 3. /usr/bin/cvs checkout -r $(BRANCH) freetds > Personally I use a separate directory for my development and stuff like this. This cause if I want do do some experiment without committing or other dirty stuff and I don't want to lose files. To "copy" from external repository to your you can do a "git fetch". If you want to remove files created you can use, as Craig suggested, the "git clean" command. To get a specified branch the command is "git checkout" that works on your repo (in cvs there is not such distinction). If you have to revert changes you did to some files (in the repo) you can use "git reset --hard HEAD". Another way to achieve this is to fetch a given tar/gz from a repo and extract in an empty directory, something like REPO=/your_even_dirty_working_directory WORK=/your_temporary_directory cd $REPO git fetch --all # get all branches into your repo for B in master Branch-0_91; do cd $WORK rm -rf $B cd $REPO git archive $B --prefix=$B/ | (cd $WORK && tar xf -) cd $WORK # put your stuff here ... done Probably you can avoid some cd using --git-dir REPO=/your_even_dirty_working_directory/.git WORK=/your_temporary_directory git --git-dir=$REPO fetch --all # get all branches into your repo cd $WORK for B in master Branch-0_91; do rm -rf $B git --git-dir=$REPO archive $B --prefix=$B/ | tar xf - # put your stuff here ... done I would also suggest a "set -e" command to stop on every error (from the "Paranoid shell scripts" guide :) But perhaps even on the good one) > The equivalent would seem to be "git clone" but that seems somehow > barbaric. My intuition tells me that's not the git way, because > distributed repositories are designed to avoid refetching the code. > In this case you have to fetch in order to be sure updating a version from server > If avoiding rm -rf, I'd like advice on programmatically detecting and > reverting modified files. (Files can be modified, both inadvertently > and intentionally in the process of producing the tarball. Consider > configure.ac and the SONAME.) > > Suggestions? > Mmmm... why they have to be modified?? I don't remember. Frediano _______________________________________________ FreeTDS mailing list [email protected] http://lists.ibiblio.org/mailman/listinfo/freetds