0

I know, I should only change files in a project, when the repository is opened. But I now tried to see what happens when I change a file when the repo is closed, because I will often do that, because I'm going to forget to open repos. It's inconvenient ...

Now I see what happens: changes are not recognised. Doing a commit, I get the message "nothing has changed" ... which is not true.

What can I do to make fossil recognise missed changes?

Ralf
  • 598
  • 1
  • 7
  • 17
  • Now I tried the same thing again. This time, when re-opening the repo, I'm asked whether I wish to "overwrite" the changed file ... Overwriting means overwriting the new file with the old one! (Just in case s.o. else is wondering ...) --- choosing No, the changes remain intact, and a commit recognises the changes. So I wonder why this did not work the first time I tried. – Ralf Jun 28 '12 at 15:04

1 Answers1

1

Why did you close the repository? When you do fossil open, fossil will try to deploy the latest version. Maybe it has overwritten your files…

You should use open .... --keep if you don't want to harm your working directory.

As a comparison with git (seems that it's your background):

  • in git, each working directory has its own .git folder. Multiple working directories for the same repository are typically hardlinked.
  • in fossil, each working directory contains a file named _FOSSIL_ or maybe .fossil depending on your version. It contains both a pointer to the repository (the object database) plus workingdir-specific data (what you'd call HEAD, stash, uncommitted additions/deletions/renames). close will delete that file. So, in git terms, it's like if you did git clone --bare . some_other_folder.git and then recursive rmdir .git. You still have the project history somewhere, but all information about your working tree is lost.
Benoit
  • 76,634
  • 23
  • 210
  • 236
  • Why not? From the docs, as far as I read, I understood it's the normal workflow. Open, change files, close. So is it rather Open, finish project, close? Can I have several repos open at once? I might have to read the full docs after all ... – Ralf Jun 29 '12 at 07:24
  • 2
    You never have to close, unless your project is finished or you abandon a working tree. `close` detaches the working directory from the repository (in git terms, it would move the `.git` folder away). Open, change files, commit, change files, commit, etc. You can have a repository open at multiple locations at once if you want. – Benoit Jun 29 '12 at 07:53