Re: [RFC] Zit: the git-based single file content tracker
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Oct 23, 2008, 13:51 UTC
- Message-ID
- <fcaeb9bf0810230651j1c02de13j61238c97661c32e9@mail.gmail.com>
- In-Reply-To
- <cb7bb73a0810230633r9970a50mbb4ecf3a855c3a21@mail.gmail.com>
On 10/23/08, Giuseppe Bilotta <giuseppe.bilotta@gmail.com> wrote:
Show 18 quoted lines
> On Thu, Oct 23, 2008 at 2:50 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote: > > On 10/23/08, Giuseppe Bilotta <giuseppe.bilotta@gmail.com> wrote: > >> The principle is extremely simple: when you choose to start tracking a > >> file with Zit, > >> > >> zit track file > >> > >> Zit will create a directory .zit.file to hold a git repository > >> tracking the single file .zit.file/file, which is just a hard link to > >> file. > > > > Why not use one .zit repo and track each file on each own branch?. > > > So your proposal is to have a single .zit repo which is actually a git > repo and where each additional tracked file becomes its own branch, > and zit would take care of switching from branch to branch when zit > commands are called?
I don't know if switching is necessary. With one file per pranch, the index is even not necessary.
Show 7 quoted lines
> I think this solution would have a number of problems, apart from > being generally quite messy. First of all, moving a file and its > history somewhere else means toying around with the history of a much > wider repo, whereas the current approach would mean just moving the > .zit.file dir together with the file (modulo hardlinks). Non-linear > histories for a single file would be more complex to handle, too. And > publishing just the history of one file would be damn complex.
The history should be linear. Git (or zit) repository is just a container for git branches. Each branch contains only one file. Moving a file history is equivalent to "git push" + "git branch -D". Something like this (not tested):
cd dst git init cd src git push dst local-branch:remote-branch git branch -D local-branch git gc
> -- > Giuseppe "Oblomov" Bilotta >
-- Duy