[Vm-dev] equivalent of svn export...

Ben Coman btc at openinworld.com
Tue Jun 28 00:28:41 UTC 2016


On Tue, Jun 28, 2016 at 2:08 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
> Hi All,
>
>     I have build.linux32ARM which is full of generated crap.  I have renamed it to build.linux32ARMv6 via git mv build.linux32ARM build.linux32ARMv6.  So far so good.  Now I want to clone the clean state of build.linux32ARMv6 (or of https://github.com/OpenSmalltalk/vm/build.linux32ARMv6) to create the clean state of build.linux32ARMv7. But I can't?!?!?

I was curious to learn the answer to this, so I found these...

Stack Overflow, Record file copy operation with Git:
Git does not do rename tracking nor copy tracking,
which means it doesn't record renames or copies.
What it does instead is rename and copy detection
http://stackoverflow.com/questions/1043388/record-file-copy-operation-with-git

One of the things Git gets right:
Fancy file rename and copy detection deduced merely by looking at the
commit graph. It doesn't need any metadata to be stored. If you store
metadata, you're locking yourself into the best algorithms you had at
the time of storage; if you forget metadata and instead deduce you can
always use the very best algorithms available at the time you examine
the history.
http://www.wincent.com/a/about/wincent/weblog/archives/2007/11/one_of_the_thin.php

Git Mail List, How to fork a file (git cp ?)
Øyvind A. Holm response:
Git has a rename command git mv, but that is just for
convenience. The effect is indistinguishable from removing the file and
adding another with different name and the same content
http://git.661346.n2.nabble.com/How-to-fork-a-file-git-cp-td6331860.html

Code Archaeology With Git:
takes a look at techniques for separating the interesting commits from
the uninteresting ones
http://jfire.io/blog/2012/03/07/code-archaeology-with-git/

Configure git diff to default to rename and copy detection:
    git config --global diff.renames copies
http://nuclearsquid.com/writings/git-tricks-tips-workflows/

>
> In Subversion one can extract a subdirectory of the entire repository; great for Travis builds, where one doesn't waste time cloning the entire repository.  Does git simply not support this?  I see
>   http://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export
> but it doesn't appear to offer a solution beyond cloning the entire repository :-(

Build systems can use a shallow clone...
   git clone --depth depth remote-url
or single branch clone...
  git clone URL --branch branch_name --single-branch [folder]
http://blogs.atlassian.com/2014/05/handle-big-repositories-git/

cheers -ben


More information about the Vm-dev mailing list