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

Re: git guidance

From
Andreas Ericsson <ae@op5.se>
Date
Dec 7, 2007, 12:30 UTC
Message-ID
<47593D00.9030003@op5.se>
In-Reply-To
<200712071353.11654.a1426z@gawab.com>
Al Boldi wrote:
Show 31 quoted lines
> Andreas Ericsson wrote:
>> So, to get to the bottom of this, which of the following workflows is it
>> you want git to support?
>>
>> ### WORKFLOW A ###
>> edit, edit, edit
>> edit, edit, edit
>> edit, edit, edit
>> Oops I made a mistake and need to hop back to "current - 12".
>> edit, edit, edit
>> edit, edit, edit
>> publish everything, similar to just tarring up your workdir and sending
>> out ### END WORKFLOW A ###
>>
>> ### WORKFLOW B ###
>> edit, edit, edit
>> ok this looks good, I want to save a checkpoint here
>> edit, edit, edit
>> looks good again. next checkpoint
>> edit, edit, edit
>> oh crap, back to checkpoint 2
>> edit, edit, edit
>> ooh, that's better. save a checkpoint and publish those checkpoints
>> ### END WORKFLOW B ###
> 
> ### WORKFLOW C ###
> for every save on a gitfs mounted dir, do an implied checkpoint, commit, or 
> publish (should be adjustable), on its privately created on-the-fly 
> repository.
> ### END WORKFLOW C ###
> 

So you *do* want an editor's undo function, but for an entire filesystem. That's a handy thing to have every now and then, but it's not what git (or any other scm) does.

Show 10 quoted lines
> For example:
> 
>   echo "// last comment on this file" >> /gitfs.mounted/file
> 
> should do an implied checkpoint, and make these checkpoints immediately 
> visible under some checkpoint branch of the gitfs mounted dir.
> 
> Note, this way the developer gets version control without even noticing, and 
> works completely transparent to any kind of application.
> 

One other thing that's fairly important to note is that this can never ever handle changesets, since each write() of each file will be a commit on its own. It's so far from what git does that I think you'd be better off just implementing it from scratch, or looking at a versioned fs, like Jakub suggested in his reply.

You're also neglecting one very important aspect of what an SCM provides
if you go down this road, namely project history. You basically have two
choices with this "implicit save on each edit":
* force the user to supply a commit message for each and every edit
* ignore commit messages altogether

Obviously, forcing a commit message each time is the only way to get some sort of proper history to look at after it's done, but it's also such an appalling nuisance that I doubt *anyone* will actually like that, and since changesets aren't supported, you'll have "implement xniz api, commit 1 of X" messages. Cumbersome, stupid, and not very useful.

Ignoring commit messages altogether means you ignore the entire history, and the SCM then becomes a filesystem-wide "undo" cache. This could ofcourse work, but it's something akin to building a nuclear powerplant to power a single lightbulb.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Johannes SchindelinNext: david@lang.hm
Message 20 of 25 in “Re: git guidance”
  1. Jing XueNov 29, 2007
  2. Linus TorvaldsNov 29, 2007
  3. Al BoldiDec 1, 2007
  4. Phillip SusiDec 4, 2007
  5. Al BoldiDec 7, 2007
  6. Andreas EricssonDec 6, 2007
  7. Al BoldiDec 7, 2007
  8. Johannes SchindelinDec 6, 2007
  9. Al BoldiDec 7, 2007
  10. Andreas EricssonDec 7, 2007
  11. Al BoldiDec 7, 2007
  12. Jakub NarebskiDec 7, 2007
  13. Al BoldiDec 7, 2007
  14. valdis.kletnieks@vt.eduDec 7, 2007
  15. Luke LuDec 7, 2007
  16. Al BoldiDec 8, 2007
  17. valdis.kletnieks@vt.eduDec 8, 2007
  18. Al BoldiDec 8, 2007
  19. Johannes SchindelinDec 8, 2007
  20. Andreas EricssonDec 7, 2007
  21. david@lang.hmDec 7, 2007
  22. Björn SteinbrinkDec 7, 2007
  23. inotify-commit, was Re: git guidanceJohannes Schindelin, Aug 28, 2009
  24. Phillip SusiDec 6, 2007
  25. Martin LanghoffDec 8, 2007

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.