[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gitification (was Re: /etc/fstab question (problem)?



On 4/20/23 14:51, songbird wrote:
David Christensen wrote:
...
Please describe your use-case(s), what the requirements are and why, and
how Git is failing.

   i require maintaining an accurate record of the
file and it's attributes - i consider that a part of
the reason the file exists to begin with (otherwise
why have a different file at all?).

   if you change a file, do a git commit then go back
later and do a git restore of a different version it
will not restore the file attributes of that version.
so while i expect to see the right date and time
stamp on a file that has been restored it isn't what
happens.

   and no, i don't considering catering to make being
broken or needing to use a time stamp to keep track
of changed file a requirement, if i personally need
to rebuild a project and i'm using git i would make
sure to have things properly cleaned up so that it
would work without me having to not properly record
the file attributes (or to restore them if i need to
use a different version).

   in my recent case of git screwing me over i had a
series of files in several directories all with proper
dates and time stamps and i forgot about git being a
git and did a git restore and every subdirectory was
corrupted and i had to go back and restore them
again (and then i removed that project from using git
so i'd not do it again).


   songbird


So, you need preservation of mtime (?).


Another reader pointed to Git work-arounds, so I will not repeat that.


Another idea would be to use ZFS:

1.  Create a ZFS file system for one project.

2. Check-out or create the project working directory within the ZFS file system.

3.  Whenever you check-in, also create a ZFS snapshot.

4. ZFS snapshots can be accessed via the Unix file system at <mountpoint>/.zfs/snapshot. Both the data and metadata are read-only, and match the state of the file system when the snapshot was taken.

5. You can roll back a file system to the most recent snapshot with the 'zfs rollback' command. ZFS can also roll back to an older snapshot, if you are willing to destroy all intermediate snapshots. 'rsync -a' could achieve the same result without destroying snapshots.

6.  Another possibility would be to make a clone based upon a snapshot.


David


Reply to: