Fossil User Forum

how to not commit files into Fossil
Login

how to not commit files into Fossil

how to not commit files into Fossil

(1) By anonymous on 2025-05-24 01:56:03 [link] [source]

我有一些二进制文件,不适合用fossil来管理。 但是,我觉得fossil的校验机制非常好——它能记录文件列表的变迁。 是否有办法创建一种特殊的fossil文件——它不会把文件提交进fossil里。

I have some binary files that are not suitable for management with Fossil. However, I think Fossil's verification mechanism is excellent—it can record changes in the file list. Is there a way to create a special type of Fossil file—one that doesn't commit the files into Fossil?

(2.1) By Stephan Beal (stephan) on 2025-05-24 03:33:58 edited from 2.0 in reply to 1 [link] [source]

Is there a way to create a special type of Fossil file—one that doesn't commit the files into Fossil?

No. Can you explain to us how that might be helpful?

Edit: or maybe unversioned files is what you want?

(3) By anonymous on 2025-05-24 04:35:33 in reply to 2.1 [link] [source]

unversioned files 不行,因为它没有完整的文件历史脉络,并且不好配合fossil change。

unversioned files won't work because they don't have a complete file history and don't integrate well with fossil change.

Can you explain to us how that might be helpful?

存在一些流氓软件偷删用户的文件,尤其是音乐软件(要细谈的话,我可以给出相关网址链接与新闻)。 如果用fossil来跟踪这些文件的话,就能发现自己的文件是否被偷删了。

但是这些文件大都是二进制文件,不太适合提交进入fossil文件。 所以我就想,fossil是否能跟踪这些文件,但并不把这些文件实际提交进fossil里去,保留那些文本化的提交记录。

there are instances of rogue software secretly deleting users' files, particularly music apps (if we want to go into detail, I can provide relevant links and news reports).

If Fossil were used to track these files, users could detect whether their files were being stealthily deleted.

However, most of these files are binary files, which aren’t well-suited for committing directly into Fossil.

So, I was wondering—could Fossil track these files without actually committing them into the repository, keeping the textual commit records?

(6) By Stephan Beal (stephan) on 2025-05-24 11:17:51 in reply to 3 [link] [source]

So, I was wondering—could Fossil track these files without actually committing them into the repository, keeping the textual commit records?

No. The commit records are the whole files.

(7) By Dave St.Germain (davestg) on 2025-05-24 14:02:57 in reply to 6 [link] [source]

Technically, the fossil file format only tracks the checksum of the files and doesn’t care where the content lives. It’s an implementation detail that the file blobs are stored in the repository.

One could imagine a modified fossil that didn’t store the blobs, though I have no idea how difficult of a change that would be.

(9) By Stephan Beal (stephan) on 2025-05-24 15:02:33 in reply to 7 [source]

Technically, the fossil file format only tracks the checksum of the files and doesn’t care where the content lives.

True, fossil doesn't technically care where it lives, but in really it very much expects it to be in the blob table (or nowhere).

... I have no idea how difficult of a change that would be.

It would be significant. The architecture doesn't care, but fossil's internals most certainly do.

(10.2) By Andy Bradford (andybradford) on 2025-05-24 16:08:21 edited from 10.1 in reply to 3 [link] [source]

> So, I was wondering---could Fossil  track these files without actually
> committing  them  into  the  repository, keeping  the  textual  commit
> records?

If what you're trying to track is  metadata about a file rather than the
actual contents  of the file,  then you  may be interested  in something
like:

https://man.openbsd.org/mtree
https://man.openbsd.org/changelist

Basically you  would come up  with what  you consider represent  the "at
rest" state of  the files that you  are tracking and commit  that to the
Fossil repository.  That would  become the "source  of truth"  for those
things.  In your  file you  could include  hashes (multiple  variants if
you're paranoid),  file sizes,  permissions, etc.  Then create  a script
that interprets that file to validate that the files are still correct.

Andy

(4) By Jörgen Kosche (jkosche) on 2025-05-24 09:40:20 in reply to 1 [link] [source]

Do you mean ignored files? These aren't committed.

You can define an ignore-list in the file .fossil-settings/ignore-glob in your working directory. This file takes a filename or a pattern per line, and the patterns can catch a multitude of files. For instance:

*.exe
data.bin
images/thumbnail-*.png

Files defined this way will not be committed to the repository.

Not sure if that is what you're asking for.

(5) By Jörgen Kosche (jkosche) on 2025-05-24 10:03:03 in reply to 1 [link] [source]

OK, putting the chinese text in different translators I get the feeling I am missing a component here. But again, an automatic translation means I still can't be sure I understand what you mean. But comparing these different translations, I get the feeling you want the following:

  1. you have binary files
  2. you don't want to store their content in in the repository
  3. BUT - you want to keep track of changes to these files, even if you don't want to store their contents

If (and that is a big if) that is what you mean, then I don't know of a mechanism of fossil that does that. Someone more knowledgable with fossil might have an idea. But with my current knowledge I would use a workaround. I would use a checksum program like shasum (on Windows there might be different ones) and execute it:

$ shasum src/*.c                                                                                                                                                                                                                                                                                         
2558d93f8966bb8f5d2b36ed12a38f2251a5b540  src/add.c                                                                                                                                                                                                                                                                             
2158039614355075a45e0d96d618095366a11e4f  src/ajax.c                                                                                                                                                                                                                                                                            
8bddbe362ab27b8f54f8592af88b6cf4009dac38  src/alerts.c                                                                                                                                                                                                                                                                          
b3ddab9d01de07d451214dc5be6213e0822f1e30  src/allrepo.c                                                                                                                                                                                                                                                                         
242ac945f2189571fb9b03e1161e09c855d5d24c  src/attach.c                                                                                                                                                                                                                                                                          
d98242839ace3c262af9815e086bb2fe9bd0d4f7  src/backlink.c                                                                                                                                                                                                                                                                        
d96199ab75295396fcef54267b7c93cc560bc616  src/backoffice.c  

As you can see this gives you a list of the files with their current checksum. You can pipe that output into a file and put that file into version control (while ignoring the actual binary files like I described in my other post). That line can be put into a script, so you can always execute it at checkin. If the binary files change, the checksum will change and you can track these changes on the file you piped that output into. Still a workaround, but the best I can come up with.

Again - this all depends on my understanding of your question. Sorry about the language barrier.

(8) By anonymous on 2025-05-24 14:59:24 in reply to 5 [link] [source]

谢谢你,这也是一个可行的办法。

Thank you, this is also a feasible solution.