git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC] Zit: the git-based single file content tracker

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Oct 23, 2008, 01:29 UTC
Message-ID
<gdok16$vh2$1@ger.gmane.org>
Hello all,

one of the common remarks done about git is that since it tracks tree contents, it's not the best-suited tool to track a bunch of independent files which happen to be in the same directory.

I've found myself in the situation of wanting to track my changes done to one or more 'single' files in a directory (e.g. $HOME), and deciding to use antiquate, clumsy, slow and inefficient but file-based RCS (yes, you read that right) over git.

In other situations (e.g. for my UserJS folder) I ended up using git, but not liking the idea of having things such as tags referring to all of my UserJS projects instead of the single file they were inteded for, or having to put 'filename: ' at the beginning of commit messages just because the history was shared.

So today I decided to start hacking at a git-based but file-oriented content tracker, which I decided to name Zit.

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.

The reason for using .zit.file as a non-bare repository rather than just a GIT_DIR is that it allows things such as 'git status' to ignore everything else. A possible alternative could have been to use .zit.file as the GIT_DIR and create an all-encopassing .zit.file/info/exclude, but the general idea of having this kind of detached GIT_DIR felt less robust (or maybe I just forgot some export).

I also don't like the idea of the hardlink, first of all because of portability problems, and secondly because of the way too many possibility that the hardlink broke somewhere along the way. For example, I haven't tested any fancy git commands on my sample zit implementation, and I'm not sure checking out some older version would actually work.

If anybody is intered in trying out my quick hack for the idea, there's a git repository for Zit at git://git.oblomov.eu/zit --beware that nothing past the most elementary uses (i.e. diff, status, log, commit) has been tested yet. Many commands are bound to fail due to the braindead way commands are delegated to git.

Suggestions on the best way to approach the many limits of the implementation are more than welcome.

-- 
Giuseppe "Oblomov" Bilotta
Next: Felipe Oliveira Carvalho
Message 1 of 38 in “[RFC] Zit: the git-based single file content tracker”
  1. Giuseppe BilottaOct 23, 2008
  2. Felipe Oliveira CarvalhoOct 23, 2008
  3. Nguyen Thai Ngoc DuyOct 23, 2008
  4. Giuseppe BilottaOct 23, 2008
  5. Nguyen Thai Ngoc DuyOct 23, 2008
  6. Giuseppe BilottaOct 23, 2008
  7. Johannes SixtOct 23, 2008
  8. Giuseppe BilottaOct 23, 2008
  9. Johannes SchindelinOct 24, 2008
  10. Giuseppe BilottaOct 24, 2008
  11. [RFC] Zit (v2): the git-based single file content trackerGiuseppe Bilotta, Oct 23, 2008
  12. david@lang.hmOct 24, 2008
  13. Giuseppe BilottaOct 24, 2008
  14. Jakub NarebskiOct 24, 2008
  15. Giuseppe BilottaOct 24, 2008
  16. Jakub NarebskiOct 26, 2008
  17. Giuseppe BilottaOct 26, 2008
  18. Jakub NarebskiOct 26, 2008
  19. Giuseppe BilottaOct 26, 2008
  20. Jean-Luc HerrenOct 23, 2008
  21. Giuseppe BilottaOct 24, 2008
  22. Jakub NarebskiOct 24, 2008
  23. Giuseppe BilottaOct 24, 2008
  24. Jakub NarebskiOct 24, 2008
  25. Giuseppe BilottaOct 24, 2008
  26. Junio C HamanoOct 24, 2008
  27. david@lang.hmOct 24, 2008
  28. Giuseppe BilottaOct 24, 2008
  29. david@lang.hmOct 24, 2008
  30. Giuseppe BilottaOct 24, 2008
  31. david@lang.hmOct 24, 2008
  32. Giuseppe BilottaOct 24, 2008
  33. Jakub NarebskiOct 24, 2008
  34. Giuseppe BilottaOct 25, 2008
  35. Jakub NarebskiOct 25, 2008
  36. Giuseppe BilottaOct 25, 2008
  37. david@lang.hmOct 24, 2008
  38. Giuseppe BilottaOct 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.