├── (testTest) ├── TasksCurrent.txt ├── UntitledDocument ├── GPTConversation.txt ├── .gitignore ├── git-meta-playground ├── to-merge ├── Tasks.txt ├── LICENSE ├── README.md └── git-meta.pl ├── .gitmeta-cid ├── .gitmeta ├── install.sh ├── .folderstamp5.log.html5 ├── README.md ├── init.sh ├── pre-commit ├── .folderstamp1 ├── git-meta ├── .folderstamp3 ├── .folderstamp4 ├── .folderstamp2 └── Tasks.txt /(testTest): -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TasksCurrent.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /UntitledDocument: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GPTConversation.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nostalgit/ 2 | -------------------------------------------------------------------------------- /git-meta-playground: -------------------------------------------------------------------------------- 1 | ../playgrounds/git-meta-playground -------------------------------------------------------------------------------- /to-merge/Tasks.txt: -------------------------------------------------------------------------------- 1 | - CursorGPT analyse this and how to build (in Bash) from scratch. D-NT-DSC-TH-PRP! 2 | 3 | Full info about: https://github.com/01VCS/git-meta/issues/11 4 | -------------------------------------------------------------------------------- /.gitmeta-cid: -------------------------------------------------------------------------------- 1 | .gitmeta-cid version: r4 2 | Branch: main 3 | Previous commit: QmeAq2CSpSVhu4hv1khLZr7FUQ6zFy4MquWd5y6MjmBfZK 4 | Previous commit (classic git hash): 5395267ff743fe8a5fd86174a52901bbdf9b7c1f 5 | 6 | ------------------------------ 7 | 8 | Files: 9 | (testTest): QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 10 | UntitledDocument: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 11 | pre-commit: QmXdgUpdDddtkS6BNAE6NKx98Hnyj72tBqrBiFLKnCBkaK 12 | -------------------------------------------------------------------------------- /.gitmeta: -------------------------------------------------------------------------------- 1 | commit Qma5tn6ZARmprgvV5mmbUWHrmrBKrJTGQbXTv49RVaBD81 2 | Branch: main 3 | Signed-off by: danimesq.eth (0xDDfC2e10702d8A781727A34D83B3bb3CA94a3E91) 4 | Signature: a1c8dbe9d1409f8b863e5116c79fb5f2c65316039c9132ea50aec5546794974403966179792f0ca7771dd996aa6803a4052c4bbf3ef90f9fd8efb755c015997201 5 | 6 | ------------------------------ 7 | 8 | .gitmeta version: r6 9 | Local folder: /media/daniella/B/git/nerdy DAOs/01VCS/git-meta 10 | Remote Name: origin 11 | Remote URL: https://github.com/01VCS/git-meta.git 12 | 13 | ------------------------------ 14 | 15 | chown -h 1000:1000 './(testTest)' 16 | chmod 0664 './(testTest)' 17 | /usr/bin/touch -hcmd "2024-03-15 17:57:26.7113822000 -0300" './(testTest)' 18 | /usr/bin/touch -hcad "2024-03-18 05:54:26.8519488000 -0300" './(testTest)' 19 | chown -h 1000:1000 './UntitledDocument' 20 | chmod 0664 './UntitledDocument' 21 | /usr/bin/touch -hcmd "2024-03-15 17:57:40.4637086000 -0300" './UntitledDocument' 22 | /usr/bin/touch -hcad "2024-03-18 05:55:27.1887443000 -0300" './UntitledDocument' 23 | chown -h 1000:1000 './pre-commit' 24 | chmod 0664 './pre-commit' 25 | /usr/bin/touch -hcmd "2024-03-18 21:48:59.1019923000 -0300" './pre-commit' 26 | /usr/bin/touch -hcad "2024-03-18 21:49:10.2657155000 -0300" './pre-commit' 27 | -------------------------------------------------------------------------------- /to-merge/LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Installing git-meta's dependencies..." 4 | sudo apt install gawk #from https://askubuntu.com/a/1187678 5 | 6 | echo "Installing git-meta syswide..." 7 | 8 | #sudo cp -f ethgas /usr/bin/ethgas 9 | 10 | if [ ! -e /usr/lib/01 ]; then sudo mkdir /usr/lib/01; fi 11 | if [ ! -e /usr/lib/01/git-meta ]; then sudo mkdir /usr/lib/01/git-meta; fi 12 | sudo cp -f git-meta /usr/bin/ 13 | sudo cp -f init.sh /usr/lib/01/git-meta/ 14 | sudo cp -f pre-commit /usr/lib/01/git-meta/ 15 | sudo cp -f README.md /usr/lib/01/git-meta/ 16 | 17 | #installfail(){ 18 | # echo "Installation has failed." 19 | # exit 1 20 | #} 21 | 22 | if [ -f /usr/bin/git-meta ];then 23 | echo "- Turning git-meta into an executable..." 24 | sudo chmod +x /usr/bin/git-meta 25 | # if ethgas babyisalive; then echo "Done! Running 'ethgas' command as example to use it:" && (ethgas &);exit 0; else installfail; fi 26 | # else 27 | # installfail 28 | fi 29 | 30 | if [ -f /usr/lib/01/git-meta/init.sh ];then 31 | echo "- Turning git-meta's init.sh into an executable..." 32 | sudo chmod +x /usr/lib/01/git-meta/init.sh 33 | fi 34 | 35 | if [ -f /usr/lib/01/git-meta/pre-commit ];then 36 | echo "- Turning git-meta's pre-commit into an executable..." 37 | sudo chmod +x /usr/lib/01/git-meta/pre-commit 38 | fi 39 | -------------------------------------------------------------------------------- /.folderstamp5.log.html5: -------------------------------------------------------------------------------- 1 |
     __  ,
 2 |  .--()°'.' Welcome to Nushell,
 3 | '|, . ,'   based on the nu language,
 4 |  !_-(_\    where all data is structured!
 5 | 
 6 | Please join our Discord community at https://discord.gg/NtAbbGn
 7 | Our GitHub repository is at https://github.com/nushell/nushell
 8 | Our Documentation is located at http://nushell.sh
 9 | Tweet us at @nu_shell
10 | 
11 | It's been this long since Nushell's first commit:
12 | 4yr 10month 1wk 6day 15hr 55min 10sec 706ms 669µs 800ns
13 | 
14 | Startup Time: 271ms 644µs 33ns
15 | 
16 | git-meta on  main [✘?] 
17 |  folderstamp save -r
18 | 🤓📝 Working...
19 | 
20 | git-meta on  main [✘?] took 1m1s 
21 |  
22 | 
23 | 
24 | 
25 | 
26 | -------------------------------------------------------------------------------- /to-merge/README.md: -------------------------------------------------------------------------------- 1 | # git-meta 2 | 3 | Easy solution to: 4 | 5 | - maintain correct git file dates and times (and zones and microseconds), 6 | - keep the correct file owner and group (by name, not number), and 7 | - keep file permissions correct 8 | 9 | ## Synopsis 10 | 11 | 1. install it: 12 | 13 | git clone https://github.com/gitcnd/git-meta.git 14 | sudo cp -a git-meta/git-meta.pl /usr/local/bin/ 15 | 16 | 2. set up to use it: 17 | 18 | cd my_existing_repo 19 | git-meta.pl -setup -l /usr/local/bin/git-meta.pl 20 | 21 | ## How it works 22 | 23 | Installation (above) automatically creates 2 symlinks for you, using these commands:- 24 | 25 | ln -s /usr/local/bin/git-meta.pl .git/hooks/pre-commit 26 | ln -s /usr/local/bin/git-meta.pl .git/hooks/post-merge 27 | 28 | when you commit new files, the .git/hooks/pre-commit snapshots their metadata into a new file named .git-meta which is added to your project. 29 | 30 | Anytime later, when you pull from your project, .git/hooks/post-merge runs, which restores the correct file metadata. 31 | 32 | You can also manually save and restore by running `git-meta.pl -save somefile` or `git-meta.pl -restore somefile` (use . for all files recursively) 33 | 34 | 35 | # Bonus Feature 36 | 37 | This script also includes a -newgit option, which sets up and auto-configures your environment so that multiple people can work on a project, and an expanded version of it is kept up-to-date at all times: this would be ideal, for example, if you're editing websites. The web-server's "html" folder automatically stays up-to-date anytime anyone does a push. 38 | 39 | Full details are here: https://www.instructables.com/How-to-Use-git-on-Your-Own-Machines-to-Manage-Web-/ 40 | 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # git-meta 2 | 3 | Wanna git preserve your file dates? 4 | 5 | git-meta stores all files' metadata into '.gitmeta'! On every commit! 6 | 7 | Based on a gist: https://gist.github.com/andris9/1978266 8 | Also includes this fork gist: https://gist.github.com/Cojad/9205547/revisions 9 | 10 | **Update 20/10/2023**: in the 1st place: don't worry, you can still install git-meta standalone as you used to. In the 2nd place: git-meta now's part of a bigger project: [01](https://github.com/01VCS/01), a VCS layer2/aggregator. By installing 01, you're installing git-meta ready to come built-in every time you create an new repo! 11 | 12 | ## Instructions 13 | 14 | ### Initializing 15 | 16 | Copy git-meta.sh and init.sh into your repo, then type the following command: 17 | 18 | ```bash 19 | bash init.sh 20 | ``` 21 | 22 | And done, it will be initiated! 23 | 24 | ### Updating 25 | 26 | Copy an up-to-date version of git-meta.sh and update.sh into your repo, then type the following command: 27 | 28 | ```bash 29 | bash update.sh 30 | ``` 31 | 32 | Done! 33 | 34 | ### Others 35 | 36 | source: 37 | 38 | git-meta --store Cache all meta include numeric uid/gid/permission in .gitmeta 39 | git-meta -f Alias of --store 40 | 41 | git-meta --stdout Same as --store but output in console 42 | git-meta -c Alias of --stdout 43 | 44 | 45 | 46 | destination: 47 | 48 | git-meta --apply Apply/Restore meta saved in .gitmeta 49 | git-meta -r Alias of --apply 50 | 51 | 52 | ## ✨️ Contributors 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ## Announcement 61 | 62 | @DaniMesq: 63 | 64 | > It is wonderful the collaboration level the humans can naturally organize 🥰 65 | 66 | > andris9 have started this and y'all started appending into it, respecting/including the previous contributions 67 | 68 | > All of that not on a git repository, but providing a frugal way into a gist! 69 | 70 | > 71 | > In case of any interest/need (and personally this script've helped me as I have a compulsion for preserving dates), [here is a unified repository](https://github.com/Floflis/git-meta) with all of your contributions! 🎉🥳 (🎊 look like a beach bikini) 72 | > 73 | 74 | > https://github.com/Floflis/git-meta 75 | > 76 | 77 | > AntonioMeireles brayrobert201 stefanbj Explorer09 Cojad the-mars mkortleven-emg danny0838 bizonix 78 | > 79 | 80 | > Sorry arno01 for not including yours, as it seemed very incomplete and cmw reported it didn't worked. 81 | 82 | https://gist.github.com/andris9/1978266#gistcomment-3929036 83 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f .git/hooks/git-meta ] 4 | then 5 | echo "" 6 | echo "It looks like its your first time using this! 🤗" 7 | echo "- Initializing git-meta on your repo... 🧚" 8 | # cp -r -f --preserve=all git-meta.sh .git/hooks 9 | ln -s /usr/bin/git-meta .git/hooks/git-meta 10 | if [ -f .git/hooks/git-meta ]; then 11 | chmod +x .git/hooks/git-meta 12 | echo "git-meta has been placed!" 13 | echo "" 14 | echo "Initializing as git hook..." 15 | fi 16 | if [ -e .git/hooks/pre-commit ] 17 | then 18 | echo ".git/hooks/pre-commit exists. Appending to it..." 19 | cat >> .git/hooks/pre-commit <" 25 | commit_message=$(cat $1) 26 | current_branch=$(git rev-parse --abbrev-ref HEAD) #from https://dev.to/anibalardid/how-to-check-commit-message-and-branch-name-with-git-hooks-without-any-new-installation-n34 27 | # https://github.com/typicode/husky/discussions/1171 28 | 29 | if [ ! -f ".gitmeta-cid" ]; then touch .gitmeta-cid; fi 30 | 31 | echo "Branch: $current_branch" > .gitmeta-cid & #use ">" instead of ">>" as a way of emptying .gitmeta-cid before writing new commit data 32 | # Get a list of all staged files 33 | staged_files="$(git diff --cached --name-only)" 34 | # Hash (IPFS CID) the contents of each staged file, to the pipe 35 | for file in "$staged_files"; do 36 | if [ -f "$file" ]; then 37 | file_cid=$(ipfs add -q --only-hash "$file") 38 | echo "$file"": ""$file_cid" >> .gitmeta-cid & 39 | fi 40 | done 41 | 42 | commit_cid=$(ipfs add -q --only-hash .gitmeta-cid) 43 | echo "commit ""$commit_cid" > .gitmeta #use ">" instead of ">>" as a way of emptying .gitmeta before writing new commit data 44 | echo "Branch: ""$current_branch" >> .gitmeta 45 | echo "" >> .gitmeta && echo "------------------------------" >> .gitmeta && echo "" >> .gitmeta 46 | 47 | # If the .eth file exists, sign the commit data with the Ethereum account 48 | if [ -f ".git/hooks/.eth" ]; then 49 | eth_account=$(cat .git/hooks/.eth) 50 | signature=$(geth --exec "web3.personal.sign(web3.toHex('$commit_cid'), '$eth_account', null)" attach) 51 | fi 52 | 53 | bash .git/hooks/git-meta --store 54 | git add .gitmeta 55 | git add .gitmeta-cid 56 | echo "Done. Meta has been preserved!" 57 | EOF 58 | chmod +x .git/hooks/pre-commit 59 | 60 | echo "Done!" 61 | else 62 | echo ".git/hooks/pre-commit doesn't exist. Creating it..." 63 | ln -sf /usr/lib/01/git-meta/pre-commit .git/hooks/pre-commit 64 | chmod +x .git/hooks/pre-commit 65 | echo "Done!" 66 | fi 67 | #if [ ! -f ".gitmeta-cid" ]; then touch .gitmeta-cid; fi 68 | echo "Done! git-meta has been initiated in your repo!" 69 | else 70 | #if [ ! -f ".gitmeta-cid" ]; then touch .gitmeta-cid; fi 71 | echo "git-meta is already initiated in your repo." 72 | fi 73 | -------------------------------------------------------------------------------- /pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #01VCSHere 4 | 5 | echo "🤓📝 Storing files' timestamp, CID/hash; and other files/commit's metadata..." 6 | 7 | commit_author="$(git config user.name)"" <""$(git config user.email)"">" 8 | commit_message=$(cat $1) 9 | current_branch=$(git rev-parse --abbrev-ref HEAD) #from https://dev.to/anibalardid/how-to-check-commit-message-and-branch-name-with-git-hooks-without-any-new-installation-n34 10 | first_remote_name=$(git remote | head -n 1) # Define the first remote's name 11 | first_remote_url=$(git remote | head -n 1 | xargs git remote get-url) # Get the first remote's URL 12 | 13 | # https://github.com/typicode/husky/discussions/1171 14 | rocketlaunch_dir=`pwd` #from https://unix.stackexchange.com/a/52919/470623 15 | 16 | # Get a list of all staged files 17 | staged_files=$(git diff --cached --name-only) 18 | 19 | # Exit if no files are staged 20 | if [ -z "$staged_files" ]; then 21 | echo "No files staged. Exiting pre-commit hook." 22 | exit 0 23 | fi 24 | 25 | if [ ! -f ".gitmeta-cid" ]; then touch .gitmeta-cid; fi 26 | 27 | previous_commit_cid=$(ipfs add -q --only-hash .gitmeta-cid) 28 | previous_commit_githash=$(git rev-parse HEAD) 29 | 30 | echo ".gitmeta-cid version: r4 " > .gitmeta-cid #use ">" instead of ">>" as a way of emptying .gitmeta-cid before writing new commit data 31 | echo "Branch: $current_branch" >> .gitmeta-cid 32 | echo "Previous commit: $previous_commit_cid" >> .gitmeta-cid 33 | echo "Previous commit (classic git hash): $previous_commit_githash" >> .gitmeta-cid 34 | echo "" >> .gitmeta-cid && echo "------------------------------" >> .gitmeta-cid && echo "" >> .gitmeta-cid 35 | echo "Files:" >> .gitmeta-cid 36 | 37 | # Hash (IPFS CID) the contents of each staged file, to the pipe 38 | for file in $staged_files; do 39 | if [ -f "$file" ]; then 40 | file_cid=$(ipfs add -q --only-hash "$file") 41 | echo "$file"": ""$file_cid" >> .gitmeta-cid 42 | fi 43 | done 44 | 45 | commit_cid=$(ipfs add -q --only-hash .gitmeta-cid) 46 | echo "[01VCS] 🆔Commit ID: $commit_cid" 47 | 48 | echo "commit ""$commit_cid" > .gitmeta #use ">" instead of ">>" as a way of emptying .gitmeta before writing new commit data 49 | echo "Branch: ""$current_branch" >> .gitmeta 50 | 51 | # If the .eth file exists, sign the commit data with the Ethereum account 52 | if [ -f ".git/hooks/.eth" ]; then 53 | echo "💎 Found .git/hooks/.eth!" 54 | eth_account=$(cat .git/hooks/.eth) 55 | # signature=$(ethereal signature sign --nohash --data="$commit_cid" --signer="$eth_account" --passphrase="your_passphrase_here") 56 | echo "🪄 Signing the commit $commit_cid with your choosen ETH address $eth_account..." 57 | signature=$(ethereal signature sign --offline --nohash --data="$commit_cid" --signer="$eth_account" --passphrase="$(jq -r '.passphrase' $HOME/.ethereal.json)" --config $HOME/.ethereal.json) 58 | enscheck="$(ethereal ens domain get --address=$eth_account)" 59 | if [ "$enscheck" = "Failed to check reverse resolution: not a resolver" ]; then 60 | echo "Signed-off by: $eth_account" >> .gitmeta 61 | else 62 | echo "Signed-off by: $enscheck ($eth_account)" >> .gitmeta 63 | fi 64 | echo "Signature: $signature" >> .gitmeta 65 | echo "🔦 Verifying signature..." 66 | ethereal signature verify --nohash --data="$commit_cid" --signature="$signature" --signer="$eth_account" #from https://github.com/wealdtech/ethereal?tab=readme-ov-file#signature-signer 67 | fi 68 | 69 | echo "" >> .gitmeta && echo "------------------------------" >> .gitmeta && echo "" >> .gitmeta 70 | echo ".gitmeta version: r6" >> .gitmeta 71 | echo "Local folder: ""$rocketlaunch_dir" >> .gitmeta 72 | echo "Remote Name: $first_remote_name" >> .gitmeta 73 | echo "Remote URL: $first_remote_url" >> .gitmeta 74 | 75 | echo "" >> .gitmeta && echo "------------------------------" >> .gitmeta && echo "" >> .gitmeta 76 | 77 | bash .git/hooks/git-meta --store 78 | git add .gitmeta 79 | git add .gitmeta-cid 80 | echo "✅ Done. Meta has been preserved!" 81 | echo "🎉 Your snapshot/commit is done!" 82 | -------------------------------------------------------------------------------- /.folderstamp1: -------------------------------------------------------------------------------- 1 | This folder: /media/daniella/B/git/nerdy DAOs/01VCS/git-meta 2 | 3 | File: ./git-meta 4 | Size: 5462 Blocks: 16 IO Block: 4096 regular file 5 | Device: 8,4 Inode: 4261392 Links: 1 6 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 7 | Access: 2023-11-19 22:10:25.200642700 -0300 8 | Modify: 2023-09-30 18:49:01.080800000 -0300 9 | Change: 2023-09-30 18:49:01.402127400 -0300 10 | Birth: 2023-09-30 18:49:01.047833100 -0300 11 | IPFS hash: QmTyf54Dhv6xbifv7jzTo5kTywELTqm9smLkaZLVNGtjLA 12 | ------------------------------ 13 | File: ./git-meta-playground -> ../playgrounds/git-meta-playground 14 | Size: 34 Blocks: 0 IO Block: 4096 symbolic link 15 | Device: 8,4 Inode: 4303756 Links: 1 16 | Access: (0777/lrwxrwxrwx) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 17 | Access: 2024-01-17 22:07:16.591745200 -0300 18 | Modify: 2023-11-19 22:07:56.281290200 -0300 19 | Change: 2023-11-19 22:07:56.281290200 -0300 20 | Birth: - 21 | IPFS hash: QmS5A88eR1FMrFoBCxGnpfnE22tFRA3zooiMoJqRJ1yieh 22 | ------------------------------ 23 | File: ./init.sh 24 | Size: 4539 Blocks: 16 IO Block: 4096 regular file 25 | Device: 8,4 Inode: 4261441 Links: 1 26 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 27 | Access: 2023-11-19 22:10:25.484655100 -0300 28 | Modify: 2023-09-30 18:54:59.697005300 -0300 29 | Change: 2023-09-30 18:55:00.075813700 -0300 30 | Birth: 2023-09-30 18:54:59.684596000 -0300 31 | IPFS hash: QmVw1KDYz1g5w2yrS73rpGy8tm9wxMhttyz6mw45KhHaz5 32 | ------------------------------ 33 | File: ./install.sh 34 | Size: 946 Blocks: 8 IO Block: 4096 regular file 35 | Device: 8,4 Inode: 4067080 Links: 1 36 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 37 | Access: 2023-11-19 22:10:25.588659600 -0300 38 | Modify: 2023-02-01 12:18:42.431733000 -0300 39 | Change: 2023-02-01 12:18:42.763979400 -0300 40 | Birth: 2023-02-01 12:18:42.417442500 -0300 41 | IPFS hash: QmSquK75KFcAhwrBJxsyqid1KZERRbHEHTZHJRXMta1XtM 42 | ------------------------------ 43 | File: ./README.md 44 | Size: 2585 Blocks: 8 IO Block: 4096 regular file 45 | Device: 8,4 Inode: 4268801 Links: 1 46 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 47 | Access: 2023-11-19 22:10:25.676663500 -0300 48 | Modify: 2023-10-20 11:55:15.467902400 -0300 49 | Change: 2023-10-20 11:55:15.785920500 -0300 50 | Birth: 2023-10-20 11:55:15.466107400 -0300 51 | IPFS hash: QmajQsKhU8sxQMbUjTmVxV6QrayPydnMhgdDALgNSRyCpM 52 | ------------------------------ 53 | File: ./TasksCurrent.txt 54 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 55 | Device: 8,4 Inode: 3619843 Links: 1 56 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 57 | Access: 2024-01-17 22:07:39.452846400 -0300 58 | Modify: 2024-01-17 22:07:22.364026500 -0300 59 | Change: 2024-01-17 22:07:39.464847000 -0300 60 | Birth: 2024-01-17 22:07:39.452846400 -0300 61 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 62 | ------------------------------ 63 | File: ./Tasks.txt 64 | Size: 1212 Blocks: 8 IO Block: 4096 regular file 65 | Device: 8,4 Inode: 4392486 Links: 1 66 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 67 | Access: 2023-12-17 01:27:08.931980700 -0300 68 | Modify: 2023-12-17 01:26:59.132039700 -0300 69 | Change: 2023-12-17 01:26:59.460037700 -0300 70 | Birth: 2023-12-17 01:26:59.128039700 -0300 71 | IPFS hash: QmSRj9a12wWU65hZtJoUGaH9Kkm65tW66BV8JEPD8LbgZ6 72 | ------------------------------ 73 | File: ./to-merge 74 | Size: 4096 Blocks: 8 IO Block: 4096 directory 75 | Device: 8,4 Inode: 4303878 Links: 1 76 | Access: (0775/drwxrwxr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 77 | Access: 2023-11-19 22:13:50.288324500 -0300 78 | Modify: 2023-12-02 00:25:48.618997400 -0300 79 | Change: 2023-12-02 00:25:48.618997400 -0300 80 | Birth: 2023-11-19 22:13:50.288324500 -0300 81 | IPFS hash: 82 | ------------------------------ -------------------------------------------------------------------------------- /git-meta: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | #git-cache-meta -- simple file meta data caching and applying. 4 | #Simpler than etckeeper, metastore, setgitperms, etc. 5 | #from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694 6 | #modified by n1k 7 | #modified by the-mars 8 | # - save all files metadata not only from other users 9 | # - save numeric uid and gid 10 | #2012-03-05 - added filetime, by @andris9 11 | #2012-05-22 - added fix for non ASCII characters and list size, merge chgrp into chown command 12 | #2013-11-29 - fix bug at failing on files with spaces, by @AntonioMeireles and reported by @kickiss 13 | #2014-02-20 - fix bugs of previous update and touch command as the LAST, by @brayrobert201 and reported by @Explorer09 14 | #2014-02-23 - fix bugs of previous updates, by @stefanbj 15 | #2014-02-24 - important modifications/fixes by @Explorer09: 16 | # - 'touch' commands are moved to the bottom. 17 | # - File modification time and access time are stored separately. 18 | # - Timezone offsets are stored. (Strictly, the %Tz and %Az things are not documented in GNU find, but they will work as long as you have a C99-complaint library.) 19 | # - Added '-h' switch to chown and chgrp. This allows the script to handle symlinks. 20 | # - 'chmod' only if the file is not a symlink. 21 | # - All unusual filenames are properly escaped, thanks to '-exec ls --quoting-style=shell'. Notice that '--quoting-style=c' does not work as it seems when there are filenames that contain newlines. 22 | #2014-03-18 - @the-mars: store properties for dirs too 23 | #2015-04-17 - time zone offset fallback; fix leading-dash-name error; avoid deeper find; 24 | # better quote file names; better directory listing; merge short opts; by Danny Lin (@danny0838) 25 | #2015-05-07 - for Mac OS X, `brew install findutils gawk coreutils`, by @bizonix 26 | 27 | : ${GIT_CACHE_META_FILE=.gitmeta} 28 | 29 | if [[ "$OSTYPE" == "darwin"* ]]; then 30 | GNU='g' 31 | fi 32 | for bin in find touch awk ; do 33 | BIN=$( echo $bin | tr '[:lower:]' '[:upper:]') 34 | eval ': ${'$BIN':=$(which $GNU$bin)}' 35 | if [ "$GNU" == 'g' ] && ! [[ "${!BIN}" =~ /$GNU$bin ]] ; then 36 | echo "gnu version of '$bin' file not found." >&2 37 | exit 1 38 | fi 39 | done 40 | 41 | : ${Tz:=$($FIND -prune -printf '%Tz')} 42 | : ${Tz:=$(date +%z)} 43 | if ! [ "$Tz" ]; then 44 | echo "%z not supported in 'strftime' in C library." >&2 45 | exit 1 46 | fi 47 | 48 | if [ ! -f .gitmeta ] 49 | then # if the flag hasn't been placed, this is the first use 50 | echo "Its your first time using git-meta on this repository!" 51 | case $@ in 52 | --store|--stdout) 53 | case $1 in --store) exec >> $GIT_CACHE_META_FILE; esac 54 | { git ls-tree --name-only -rdz $(git write-tree) | xargs -0 -I NAME $FIND ./NAME -maxdepth 0 \ 55 | \( -printf 'chown -h %U:%G \0%p\n' \) , \ 56 | \( \! -type l -printf 'chmod %#m \0%p\n' \) , \ 57 | \( -printf $TOUCH' -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \ 58 | \( -printf $TOUCH' -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \) 59 | git ls-files -z | xargs -0 -I NAME $FIND ./NAME -maxdepth 0 \ 60 | \( -printf 'chown -h %U:%G \0%p\n' \) , \ 61 | \( \! -type l -printf 'chmod %#m \0%p\n' \) , \ 62 | \( -printf $TOUCH' -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \ 63 | \( -printf $TOUCH' -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \) 64 | } | $AWK -v exclude=".gitmeta .gitmeta-cid" 'BEGIN {FS="\0"; split(exclude, ex, " ")}; {exclude_file=0; for(i in ex) if($2 == "./" ex[i]) exclude_file=1; if(!exclude_file) print $1 "'\''" gensub(/'\''/, "'\''\\\\'\'''\''", "g", $2) "'\''" }' ;; 65 | --apply) sh -e $GIT_CACHE_META_FILE;; 66 | *) 1>&2 echo "Usage:" 67 | echo " $0 --store|--stdout|--apply"; 68 | echo " --store -f store meta in file"; 69 | echo " --stdout -c output to cosole"; 70 | echo " --apply -r restore meta"; exit 1;; 71 | esac 72 | #Would you like to add all files that are on the working tree (even the not versioned ones)? 73 | #https://www.google.com/search?q=ls+all+files+recursively+except+some&client=ubuntu&hs=fhV&channel=fs&ei=HzWUYffIDKbN1sQPsu6n-AM&oq=ls+all+files+recursively+except+some&gs_lcp=Cgdnd3Mtd2l6EAM6BwgAEEcQsANKBAhBGABQFlgWYJUEaAFwAngAgAG0AYgBtAGSAQMwLjGYAQCgAQHIAQjAAQE&sclient=gws-wiz&ved=0ahUKEwi31M28-530AhWmppUCHTL3CT8Q4dUDCA0&uact=5 74 | else 75 | case $@ in 76 | --store|--stdout) 77 | case $1 in --store) exec >> $GIT_CACHE_META_FILE; esac 78 | { git diff --name-only -z HEAD | xargs -0 -I NAME $FIND ./NAME -maxdepth 0 \ 79 | \( -printf 'chown -h %U:%G \0%p\n' \) , \ 80 | \( \! -type l -printf 'chmod %#m \0%p\n' \) , \ 81 | \( -printf $TOUCH' -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \ 82 | \( -printf $TOUCH' -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \) 83 | # git ls-files -mz | xargs -0 -I NAME $FIND ./NAME -maxdepth 0 \ 84 | # \( -printf 'chown -h %U:%G \0%p\n' \) , \ 85 | # \( \! -type l -printf 'chmod %#m \0%p\n' \) , \ 86 | # \( -printf $TOUCH' -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \ 87 | # \( -printf $TOUCH' -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \) 88 | } | $AWK -v exclude=".gitmeta .gitmeta-cid" 'BEGIN {FS="\0"; split(exclude, ex, " ")}; {exclude_file=0; for(i in ex) if($2 == "./" ex[i]) exclude_file=1; if(!exclude_file) print $1 "'\''" gensub(/'\''/, "'\''\\\\'\'''\''", "g", $2) "'\''" }' ;; 89 | --apply) sh -e $GIT_CACHE_META_FILE;; 90 | *) 1>&2 echo "Usage:" 91 | echo " $0 --store|--stdout|--apply"; 92 | echo " --store -f store meta in file"; 93 | echo " --stdout -c output to console"; 94 | echo " --apply -r restore meta"; exit 1;; 95 | esac 96 | fi 97 | -------------------------------------------------------------------------------- /.folderstamp3: -------------------------------------------------------------------------------- 1 | This folder: /media/daniella/B/git/nerdy DAOs/01VCS/git-meta 2 | 3 | File: ./git-meta 4 | Size: 5751 Blocks: 16 IO Block: 4096 regular file 5 | Device: 8,20 Inode: 2026986 Links: 1 6 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 7 | Access: 2024-03-15 17:32:05.931230000 -0300 8 | Modify: 2024-03-15 17:30:31.974960400 -0300 9 | Change: 2024-03-15 17:31:49.279176900 -0300 10 | Birth: 2024-03-15 17:30:31.966960400 -0300 11 | IPFS hash: QmWYLGFfUa8yZsTEiqAo1eZ3cgmkz5KiS7o5DB1MBbmzjj 12 | ------------------------------ 13 | File: ./git-meta-playground -> ../playgrounds/git-meta-playground 14 | Size: 34 Blocks: 0 IO Block: 4096 symbolic link 15 | Device: 8,20 Inode: 4303756 Links: 1 16 | Access: (0777/lrwxrwxrwx) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 17 | Access: 2024-03-15 14:48:19.713141600 -0300 18 | Modify: 2023-11-19 22:07:56.281290200 -0300 19 | Change: 2023-11-19 22:07:56.281290200 -0300 20 | Birth: - 21 | IPFS hash: QmS5A88eR1FMrFoBCxGnpfnE22tFRA3zooiMoJqRJ1yieh 22 | ------------------------------ 23 | File: ./GPTConversation.txt 24 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 25 | Device: 8,20 Inode: 2027058 Links: 1 26 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 27 | Access: 2024-03-15 17:47:15.891298700 -0300 28 | Modify: 2024-03-15 17:46:57.658444900 -0300 29 | Change: 2024-03-15 17:46:57.698446800 -0300 30 | Birth: 2024-03-15 17:46:57.658444900 -0300 31 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 32 | ------------------------------ 33 | File: ./init.sh 34 | Size: 2933 Blocks: 8 IO Block: 4096 regular file 35 | Device: 8,20 Inode: 2026680 Links: 1 36 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 37 | Access: 2024-03-15 15:52:52.236718100 -0300 38 | Modify: 2024-03-15 15:52:16.732408600 -0300 39 | Change: 2024-03-15 15:52:17.020410900 -0300 40 | Birth: 2024-03-15 15:52:16.712408400 -0300 41 | IPFS hash: QmP2onTksejZi4tTKiTmgeHwRYhucZycLAcywugVzoY5fm 42 | ------------------------------ 43 | File: ./install.sh 44 | Size: 1154 Blocks: 8 IO Block: 4096 regular file 45 | Device: 8,20 Inode: 2026679 Links: 1 46 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 47 | Access: 2024-03-15 15:52:52.236718100 -0300 48 | Modify: 2024-03-15 15:50:59.787852300 -0300 49 | Change: 2024-03-15 15:51:00.095854200 -0300 50 | Birth: 2024-03-15 15:50:59.779852200 -0300 51 | IPFS hash: QmXWL4d8u7bPwNBnR77KLsgjJugGt7RCnB8rtnw1H6xvQj 52 | ------------------------------ 53 | File: ./pre-commit 54 | Size: 1766 Blocks: 8 IO Block: 4096 regular file 55 | Device: 8,20 Inode: 2027125 Links: 1 56 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 57 | Access: 2024-03-15 17:52:25.583136500 -0300 58 | Modify: 2024-03-15 17:52:03.510429200 -0300 59 | Change: 2024-03-15 17:52:03.826439400 -0300 60 | Birth: 2024-03-15 17:52:03.502428900 -0300 61 | IPFS hash: QmYTsMrFPVNyRZm6MnFaSX8dxHMujnZKbrYhgG1CZRW8EU 62 | ------------------------------ 63 | File: ./README.md 64 | Size: 2585 Blocks: 8 IO Block: 4096 regular file 65 | Device: 8,20 Inode: 4268801 Links: 1 66 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 67 | Access: 2024-03-15 14:51:00.933469100 -0300 68 | Modify: 2023-10-20 11:55:15.467902400 -0300 69 | Change: 2023-10-20 11:55:15.785920500 -0300 70 | Birth: 2023-10-20 11:55:15.466107400 -0300 71 | IPFS hash: QmajQsKhU8sxQMbUjTmVxV6QrayPydnMhgdDALgNSRyCpM 72 | ------------------------------ 73 | File: ./TasksCurrent.txt 74 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 75 | Device: 8,20 Inode: 3619843 Links: 1 76 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 77 | Access: 2024-03-15 14:53:53.120155000 -0300 78 | Modify: 2024-01-17 22:07:22.364026500 -0300 79 | Change: 2024-01-17 22:07:39.464847000 -0300 80 | Birth: 2024-01-17 22:07:39.452846400 -0300 81 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 82 | ------------------------------ 83 | File: ./Tasks.txt 84 | Size: 1795 Blocks: 8 IO Block: 4096 regular file 85 | Device: 8,20 Inode: 2027057 Links: 1 86 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 87 | Access: 2024-03-15 17:47:12.323133300 -0300 88 | Modify: 2024-03-15 17:46:56.606395000 -0300 89 | Change: 2024-03-15 17:46:56.702399600 -0300 90 | Birth: 2024-03-15 17:46:56.602394800 -0300 91 | IPFS hash: QmWHx7BjqC5jgDfTUA6sUQ8T9yNdQURENBcA5Bx2NWQGnY 92 | ------------------------------ 93 | File: ./(test Test) 94 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 95 | Device: 8,20 Inode: 2027185 Links: 1 96 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 97 | Access: 2024-03-15 17:57:26.711382200 -0300 98 | Modify: 2024-03-15 17:57:26.711382200 -0300 99 | Change: 2024-03-15 17:57:33.547544900 -0300 100 | Birth: 2024-03-15 17:57:26.711382200 -0300 101 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 102 | ------------------------------ 103 | File: ./to-merge 104 | Size: 4096 Blocks: 8 IO Block: 4096 directory 105 | Device: 8,20 Inode: 4303878 Links: 1 106 | Access: (0775/drwxrwxr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 107 | Access: 2023-11-19 22:13:50.288324500 -0300 108 | Modify: 2023-12-02 00:25:48.618997400 -0300 109 | Change: 2023-12-02 00:25:48.618997400 -0300 110 | Birth: 2023-11-19 22:13:50.288324500 -0300 111 | IPFS hash: 112 | ------------------------------ 113 | File: ./Untitled Document 114 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 115 | Device: 8,20 Inode: 2027186 Links: 1 116 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 117 | Access: 2024-03-15 17:57:40.463708600 -0300 118 | Modify: 2024-03-15 17:57:40.463708600 -0300 119 | Change: 2024-03-15 17:57:40.463708600 -0300 120 | Birth: 2024-03-15 17:57:40.463708600 -0300 121 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 122 | ------------------------------ -------------------------------------------------------------------------------- /.folderstamp4: -------------------------------------------------------------------------------- 1 | This folder: /media/daniella/B/git/nerdy DAOs/01VCS/git-meta 2 | 3 | File: ./git-meta 4 | Size: 5751 Blocks: 16 IO Block: 4096 regular file 5 | Device: 8,20 Inode: 2026986 Links: 1 6 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 7 | Access: 2024-03-15 17:32:05.931230000 -0300 8 | Modify: 2024-03-15 17:30:31.974960400 -0300 9 | Change: 2024-03-15 17:31:49.279176900 -0300 10 | Birth: 2024-03-15 17:30:31.966960400 -0300 11 | IPFS hash: QmWYLGFfUa8yZsTEiqAo1eZ3cgmkz5KiS7o5DB1MBbmzjj 12 | ------------------------------ 13 | File: ./git-meta-playground -> ../playgrounds/git-meta-playground 14 | Size: 34 Blocks: 0 IO Block: 4096 symbolic link 15 | Device: 8,20 Inode: 4303756 Links: 1 16 | Access: (0777/lrwxrwxrwx) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 17 | Access: 2024-03-15 14:48:19.713141600 -0300 18 | Modify: 2023-11-19 22:07:56.281290200 -0300 19 | Change: 2023-11-19 22:07:56.281290200 -0300 20 | Birth: - 21 | IPFS hash: QmS5A88eR1FMrFoBCxGnpfnE22tFRA3zooiMoJqRJ1yieh 22 | ------------------------------ 23 | File: ./GPTConversation.txt 24 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 25 | Device: 8,20 Inode: 2027058 Links: 1 26 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 27 | Access: 2024-03-15 17:47:15.891298700 -0300 28 | Modify: 2024-03-15 17:46:57.658444900 -0300 29 | Change: 2024-03-15 17:46:57.698446800 -0300 30 | Birth: 2024-03-15 17:46:57.658444900 -0300 31 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 32 | ------------------------------ 33 | File: ./init.sh 34 | Size: 2933 Blocks: 8 IO Block: 4096 regular file 35 | Device: 8,20 Inode: 2026680 Links: 1 36 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 37 | Access: 2024-03-15 15:52:52.236718100 -0300 38 | Modify: 2024-03-15 15:52:16.732408600 -0300 39 | Change: 2024-03-15 15:52:17.020410900 -0300 40 | Birth: 2024-03-15 15:52:16.712408400 -0300 41 | IPFS hash: QmP2onTksejZi4tTKiTmgeHwRYhucZycLAcywugVzoY5fm 42 | ------------------------------ 43 | File: ./install.sh 44 | Size: 1154 Blocks: 8 IO Block: 4096 regular file 45 | Device: 8,20 Inode: 2026679 Links: 1 46 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 47 | Access: 2024-03-15 15:52:52.236718100 -0300 48 | Modify: 2024-03-15 15:50:59.787852300 -0300 49 | Change: 2024-03-15 15:51:00.095854200 -0300 50 | Birth: 2024-03-15 15:50:59.779852200 -0300 51 | IPFS hash: QmXWL4d8u7bPwNBnR77KLsgjJugGt7RCnB8rtnw1H6xvQj 52 | ------------------------------ 53 | File: ./pre-commit 54 | Size: 2212 Blocks: 8 IO Block: 4096 regular file 55 | Device: 8,20 Inode: 2027281 Links: 1 56 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 57 | Access: 2024-03-15 18:39:57.745357700 -0300 58 | Modify: 2024-03-15 18:39:57.745357700 -0300 59 | Change: 2024-03-15 18:39:58.065353100 -0300 60 | Birth: 2024-03-15 18:39:57.745357700 -0300 61 | IPFS hash: QmPSG8962ZE2zqktjNB5EckoAPrnpYE49wxbgq2eswR31G 62 | ------------------------------ 63 | File: ./README.md 64 | Size: 2585 Blocks: 8 IO Block: 4096 regular file 65 | Device: 8,20 Inode: 4268801 Links: 1 66 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 67 | Access: 2024-03-15 14:51:00.933469100 -0300 68 | Modify: 2023-10-20 11:55:15.467902400 -0300 69 | Change: 2023-10-20 11:55:15.785920500 -0300 70 | Birth: 2023-10-20 11:55:15.466107400 -0300 71 | IPFS hash: QmajQsKhU8sxQMbUjTmVxV6QrayPydnMhgdDALgNSRyCpM 72 | ------------------------------ 73 | File: ./TasksCurrent.txt 74 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 75 | Device: 8,20 Inode: 3619843 Links: 1 76 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 77 | Access: 2024-03-15 14:53:53.120155000 -0300 78 | Modify: 2024-01-17 22:07:22.364026500 -0300 79 | Change: 2024-01-17 22:07:39.464847000 -0300 80 | Birth: 2024-01-17 22:07:39.452846400 -0300 81 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 82 | ------------------------------ 83 | File: ./Tasks.txt 84 | Size: 1628 Blocks: 8 IO Block: 4096 regular file 85 | Device: 8,20 Inode: 2027223 Links: 1 86 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 87 | Access: 2024-03-15 18:27:26.968364800 -0300 88 | Modify: 2024-03-15 18:27:00.509902000 -0300 89 | Change: 2024-03-15 18:27:00.829882900 -0300 90 | Birth: 2024-03-15 18:27:00.505902200 -0300 91 | IPFS hash: QmWS4ZuzY8YdThHx4SvbqxhKzZXPfQMYJA5WHFN1LbAj8y 92 | ------------------------------ 93 | File: ./(test Test) 94 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 95 | Device: 8,20 Inode: 2027185 Links: 1 96 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 97 | Access: 2024-03-15 17:57:51.407965800 -0300 98 | Modify: 2024-03-15 17:57:26.711382200 -0300 99 | Change: 2024-03-15 17:58:50.701322900 -0300 100 | Birth: 2024-03-15 17:57:26.711382200 -0300 101 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 102 | ------------------------------ 103 | File: ./to-merge 104 | Size: 4096 Blocks: 8 IO Block: 4096 directory 105 | Device: 8,20 Inode: 4303878 Links: 1 106 | Access: (0775/drwxrwxr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 107 | Access: 2023-11-19 22:13:50.288324500 -0300 108 | Modify: 2023-12-02 00:25:48.618997400 -0300 109 | Change: 2023-12-02 00:25:48.618997400 -0300 110 | Birth: 2023-11-19 22:13:50.288324500 -0300 111 | IPFS hash: 112 | ------------------------------ 113 | File: ./Untitled Document 114 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 115 | Device: 8,20 Inode: 2027186 Links: 1 116 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 117 | Access: 2024-03-15 17:57:51.555969300 -0300 118 | Modify: 2024-03-15 17:57:40.463708600 -0300 119 | Change: 2024-03-15 17:58:52.329359300 -0300 120 | Birth: 2024-03-15 17:57:40.463708600 -0300 121 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 122 | ------------------------------ -------------------------------------------------------------------------------- /.folderstamp2: -------------------------------------------------------------------------------- 1 | This folder: /media/daniella/B/git/nerdy DAOs/01VCS/git-meta 2 | 3 | File: ./git-meta 4 | Size: 4960 Blocks: 16 IO Block: 4096 regular file 5 | Device: 8,20 Inode: 2026914 Links: 1 6 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 7 | Access: 2024-03-15 17:19:41.672465100 -0300 8 | Modify: 2024-03-15 17:19:41.544466300 -0300 9 | Change: 2024-03-15 17:19:41.600465800 -0300 10 | Birth: 2024-03-15 17:19:41.516466600 -0300 11 | IPFS hash: QmYa3mu4BJSSnfPhrtk59zvNt4KoocStwsGQhavaFqj9FW 12 | ------------------------------ 13 | File: ./git-meta-0 14 | Size: 4975 Blocks: 16 IO Block: 4096 regular file 15 | Device: 8,20 Inode: 2026913 Links: 1 16 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 17 | Access: 2024-03-15 17:17:16.234239100 -0300 18 | Modify: 2024-03-15 17:17:15.754246400 -0300 19 | Change: 2024-03-15 17:18:37.245152900 -0300 20 | Birth: 2024-03-15 17:18:33.025203100 -0300 21 | IPFS hash: QmbEJtq1bieM6jHUDCfxiBR8zccoHQZ8yN1Ufvo4Y1Fcqr 22 | ------------------------------ 23 | File: ./git-meta.gpt 24 | Size: 4990 Blocks: 16 IO Block: 4096 regular file 25 | Device: 8,20 Inode: 2026902 Links: 1 26 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 27 | Access: 2024-03-15 17:14:34.013323000 -0300 28 | Modify: 2024-03-15 17:08:38.547725100 -0300 29 | Change: 2024-03-15 17:14:33.997323400 -0300 30 | Birth: 2024-03-15 17:14:29.265434700 -0300 31 | IPFS hash: QmekBCh67aZDiR2LxTMKwsrCkob1QwV646m8v8hxnivCGa 32 | ------------------------------ 33 | File: ./git-meta-playground -> ../playgrounds/git-meta-playground 34 | Size: 34 Blocks: 0 IO Block: 4096 symbolic link 35 | Device: 8,20 Inode: 4303756 Links: 1 36 | Access: (0777/lrwxrwxrwx) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 37 | Access: 2024-03-15 14:48:19.713141600 -0300 38 | Modify: 2023-11-19 22:07:56.281290200 -0300 39 | Change: 2023-11-19 22:07:56.281290200 -0300 40 | Birth: - 41 | IPFS hash: QmS5A88eR1FMrFoBCxGnpfnE22tFRA3zooiMoJqRJ1yieh 42 | ------------------------------ 43 | File: ./git-meta.pregpt 44 | Size: 5462 Blocks: 16 IO Block: 4096 regular file 45 | Device: 8,20 Inode: 2026901 Links: 1 46 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 47 | Access: 2024-03-15 17:13:42.670604700 -0300 48 | Modify: 2024-03-15 17:13:26.767036200 -0300 49 | Change: 2024-03-15 17:13:34.426826300 -0300 50 | Birth: 2024-03-15 17:13:26.767036200 -0300 51 | IPFS hash: QmTyf54Dhv6xbifv7jzTo5kTywELTqm9smLkaZLVNGtjLA 52 | ------------------------------ 53 | File: ./GPTConversation.txt 54 | Size: 10772 Blocks: 24 IO Block: 4096 regular file 55 | Device: 8,20 Inode: 2026931 Links: 1 56 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 57 | Access: 2024-03-15 17:23:21.875046900 -0300 58 | Modify: 2024-03-15 17:23:04.831113500 -0300 59 | Change: 2024-03-15 17:23:04.883113300 -0300 60 | Birth: 2024-03-15 17:23:04.819113500 -0300 61 | IPFS hash: QmP7FRfWL9u8PjpiCDLQuLH5CVwUfzLJhKvqHY2moJbgix 62 | ------------------------------ 63 | File: ./init.sh 64 | Size: 2933 Blocks: 8 IO Block: 4096 regular file 65 | Device: 8,20 Inode: 2026680 Links: 1 66 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 67 | Access: 2024-03-15 15:52:52.236718100 -0300 68 | Modify: 2024-03-15 15:52:16.732408600 -0300 69 | Change: 2024-03-15 15:52:17.020410900 -0300 70 | Birth: 2024-03-15 15:52:16.712408400 -0300 71 | IPFS hash: QmP2onTksejZi4tTKiTmgeHwRYhucZycLAcywugVzoY5fm 72 | ------------------------------ 73 | File: ./install.sh 74 | Size: 1154 Blocks: 8 IO Block: 4096 regular file 75 | Device: 8,20 Inode: 2026679 Links: 1 76 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 77 | Access: 2024-03-15 15:52:52.236718100 -0300 78 | Modify: 2024-03-15 15:50:59.787852300 -0300 79 | Change: 2024-03-15 15:51:00.095854200 -0300 80 | Birth: 2024-03-15 15:50:59.779852200 -0300 81 | IPFS hash: QmXWL4d8u7bPwNBnR77KLsgjJugGt7RCnB8rtnw1H6xvQj 82 | ------------------------------ 83 | File: ./pre-commit 84 | Size: 1633 Blocks: 8 IO Block: 4096 regular file 85 | Device: 8,20 Inode: 2026678 Links: 1 86 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 87 | Access: 2024-03-15 15:52:52.256718200 -0300 88 | Modify: 2024-03-15 15:46:32.907491700 -0300 89 | Change: 2024-03-15 15:46:33.231490300 -0300 90 | Birth: 2024-03-15 15:46:32.907491700 -0300 91 | IPFS hash: QmV3C9xY6FSEZ2uh2KcuVGq1CTp2jGy5kNuZipHUnGtoRo 92 | ------------------------------ 93 | File: ./README.md 94 | Size: 2585 Blocks: 8 IO Block: 4096 regular file 95 | Device: 8,20 Inode: 4268801 Links: 1 96 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 97 | Access: 2024-03-15 14:51:00.933469100 -0300 98 | Modify: 2023-10-20 11:55:15.467902400 -0300 99 | Change: 2023-10-20 11:55:15.785920500 -0300 100 | Birth: 2023-10-20 11:55:15.466107400 -0300 101 | IPFS hash: QmajQsKhU8sxQMbUjTmVxV6QrayPydnMhgdDALgNSRyCpM 102 | ------------------------------ 103 | File: ./TasksCurrent.txt 104 | Size: 0 Blocks: 0 IO Block: 4096 regular empty file 105 | Device: 8,20 Inode: 3619843 Links: 1 106 | Access: (0664/-rw-rw-r--) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 107 | Access: 2024-03-15 14:53:53.120155000 -0300 108 | Modify: 2024-01-17 22:07:22.364026500 -0300 109 | Change: 2024-01-17 22:07:39.464847000 -0300 110 | Birth: 2024-01-17 22:07:39.452846400 -0300 111 | IPFS hash: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 112 | ------------------------------ 113 | File: ./Tasks.txt 114 | Size: 1915 Blocks: 8 IO Block: 4096 regular file 115 | Device: 8,20 Inode: 2026871 Links: 1 116 | Access: (0755/-rwxr-xr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 117 | Access: 2024-03-15 17:07:17.670772500 -0300 118 | Modify: 2024-03-15 17:07:08.538665500 -0300 119 | Change: 2024-03-15 17:07:08.878669500 -0300 120 | Birth: 2024-03-15 17:07:08.534665400 -0300 121 | IPFS hash: QmR7okoEJNwTwe17WPdNN1Exuk9ZdNTxqqJ9PD3LTYkEhQ 122 | ------------------------------ 123 | File: ./to-merge 124 | Size: 4096 Blocks: 8 IO Block: 4096 directory 125 | Device: 8,20 Inode: 4303878 Links: 1 126 | Access: (0775/drwxrwxr-x) Uid: ( 1000/daniella) Gid: ( 1000/daniella) 127 | Access: 2023-11-19 22:13:50.288324500 -0300 128 | Modify: 2023-12-02 00:25:48.618997400 -0300 129 | Change: 2023-12-02 00:25:48.618997400 -0300 130 | Birth: 2023-11-19 22:13:50.288324500 -0300 131 | IPFS hash: 132 | ------------------------------ -------------------------------------------------------------------------------- /Tasks.txt: -------------------------------------------------------------------------------- 1 | -? eth.json config at .git/hooks, containing the will to eth-post git CIDs, commit diffs or both (and what network to post to, each) 2 | - local (repo) or global (home folder) settings.json, containing option to run folderstamp on every commit (deactivated by default); global settings overhide repo settings when committing 3 | - 4 | - new feature: eth-post the commit's CID 5 | - new feature: eth-post on every commit (only post diff of files, serialized) - ethereal integration copyright commit's cid 6 | 7 | 8 | 9 | - in the first commit at /media/daniella/B/git/nerdy DAOs/FilePeace/file-protection-standards, .gitmeta didn't recognize .folderstamp files and .gitmeta-cid did but as .gitmeta it didn't recognize "Untitled Document" too! 10 | 11 | URGENT: .gitmeta-cid isn't containing all files .gitmeta do have. Examples: 12 | .gitmeta: 13 | chown -h 1000:1000 './.meta/.folderstamp1' 14 | chmod 0664 './.meta/.folderstamp1' 15 | /usr/bin/touch -hcmd "2024-03-16 02:05:17.5659195780 -0300" './.meta/.folderstamp1' 16 | /usr/bin/touch -hcad "2024-03-16 02:05:26.3019655550 -0300" './.meta/.folderstamp1' 17 | chown -h 1000:1000 './.meta/.folderstamp2' 18 | chmod 0664 './.meta/.folderstamp2' 19 | /usr/bin/touch -hcmd "2024-03-16 02:05:29.2979813230 -0300" './.meta/.folderstamp2' 20 | /usr/bin/touch -hcad "2024-03-16 02:05:33.6740043530 -0300" './.meta/.folderstamp2' 21 | chown -h 1000:1000 './.meta/Screenshot.png' 22 | chmod 0664 './.meta/Screenshot.png' 23 | /usr/bin/touch -hcmd "2024-03-16 02:04:53.2497916070 -0300" './.meta/Screenshot.png' 24 | /usr/bin/touch -hcad "2024-03-16 02:05:25.2539600390 -0300" './.meta/Screenshot.png' 25 | chown -h 1000:1000 './PsQueue/Draft_04-03-2024.txt' 26 | chmod 0664 './PsQueue/Draft_04-03-2024.txt' 27 | /usr/bin/touch -hcmd "2024-03-06 05:20:17.4614577010 -0300" './PsQueue/Draft_04-03-2024.txt' 28 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1065855680 -0300" './PsQueue/Draft_04-03-2024.txt' 29 | chown -h 1000:1000 './PsQueue/Draft_18-12-2023.txt' 30 | chmod 0664 './PsQueue/Draft_18-12-2023.txt' 31 | /usr/bin/touch -hcmd "2024-03-04 06:06:51.1436397070 -0300" './PsQueue/Draft_18-12-2023.txt' 32 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1105855890 -0300" './PsQueue/Draft_18-12-2023.txt' 33 | chown -h 1000:1000 './PsQueue/Draft_2023-1.txt' 34 | chmod 0664 './PsQueue/Draft_2023-1.txt' 35 | /usr/bin/touch -hcmd "2024-03-04 06:10:04.8604910060 -0300" './PsQueue/Draft_2023-1.txt' 36 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1105855890 -0300" './PsQueue/Draft_2023-1.txt' 37 | chown -h 1000:1000 './PsQueue/Draft_2023-2.txt' 38 | chmod 0664 './PsQueue/Draft_2023-2.txt' 39 | /usr/bin/touch -hcmd "2024-03-04 06:09:26.6440901820 -0300" './PsQueue/Draft_2023-2.txt' 40 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1105855890 -0300" './PsQueue/Draft_2023-2.txt' 41 | chown -h 1000:1000 './PsQueue/Draft_2023-3.txt' 42 | chmod 0664 './PsQueue/Draft_2023-3.txt' 43 | /usr/bin/touch -hcmd "2024-03-04 06:08:47.0029557030 -0300" './PsQueue/Draft_2023-3.txt' 44 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1145856100 -0300" './PsQueue/Draft_2023-3.txt' 45 | chown -h 1000:1000 './PsQueue/Draft_21-12-2023.txt' 46 | chmod 0664 './PsQueue/Draft_21-12-2023.txt' 47 | /usr/bin/touch -hcmd "2024-03-04 06:05:46.2170646920 -0300" './PsQueue/Draft_21-12-2023.txt' 48 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1145856100 -0300" './PsQueue/Draft_21-12-2023.txt' 49 | chown -h 1000:1000 './PsQueue/Draft_23-02-2024.txt' 50 | chmod 0664 './PsQueue/Draft_23-02-2024.txt' 51 | /usr/bin/touch -hcmd "2024-03-04 05:59:38.4801777250 -0300" './PsQueue/Draft_23-02-2024.txt' 52 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1145856100 -0300" './PsQueue/Draft_23-02-2024.txt' 53 | chown -h 1000:1000 './PsQueue/Draft_27-12-2023.txt' 54 | chmod 0664 './PsQueue/Draft_27-12-2023.txt' 55 | /usr/bin/touch -hcmd "2024-03-04 06:05:10.9556638030 -0300" './PsQueue/Draft_27-12-2023.txt' 56 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/Draft_27-12-2023.txt' 57 | chown -h 1000:1000 './PsQueue/Draft_29-01-2024.txt' 58 | chmod 0664 './PsQueue/Draft_29-01-2024.txt' 59 | /usr/bin/touch -hcmd "2024-03-04 06:02:48.0436068390 -0300" './PsQueue/Draft_29-01-2024.txt' 60 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/Draft_29-01-2024.txt' 61 | chown -h 1000:1000 './PsQueue/Draft_anotherunknown.txt' 62 | chmod 0664 './PsQueue/Draft_anotherunknown.txt' 63 | /usr/bin/touch -hcmd "2024-03-04 06:08:07.0851017560 -0300" './PsQueue/Draft_anotherunknown.txt' 64 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/Draft_anotherunknown.txt' 65 | chown -h 1000:1000 './PsQueue/Draft_find-tx+COMMIT.txt' 66 | chmod 0664 './PsQueue/Draft_find-tx+COMMIT.txt' 67 | /usr/bin/touch -hcmd "2024-03-04 06:00:26.2630489570 -0300" './PsQueue/Draft_find-tx+COMMIT.txt' 68 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/Draft_find-tx+COMMIT.txt' 69 | chown -h 1000:1000 './PsQueue/Draft_findtx.txt' 70 | chmod 0664 './PsQueue/Draft_findtx.txt' 71 | /usr/bin/touch -hcmd "2024-03-04 06:03:37.9564021940 -0300" './PsQueue/Draft_findtx.txt' 72 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/Draft_findtx.txt' 73 | chown -h 1000:1000 './PsQueue/Draft_tamicopyrighting.txt' 74 | chmod 0664 './PsQueue/Draft_tamicopyrighting.txt' 75 | /usr/bin/touch -hcmd "2024-03-04 06:01:25.5056252870 -0300" './PsQueue/Draft_tamicopyrighting.txt' 76 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/Draft_tamicopyrighting.txt' 77 | chown -h 1000:1000 './PsQueue/Draft_unknown.txt' 78 | chmod 0664 './PsQueue/Draft_unknown.txt' 79 | /usr/bin/touch -hcmd "2024-03-04 06:02:00.3447776760 -0300" './PsQueue/Draft_unknown.txt' 80 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/Draft_unknown.txt' 81 | chown -h 1000:1000 './PsQueue/PsQueue.txt' 82 | chmod 0664 './PsQueue/PsQueue.txt' 83 | /usr/bin/touch -hcmd "2024-03-09 21:08:16.7920536660 -0300" './PsQueue/PsQueue.txt' 84 | /usr/bin/touch -hcad "2024-03-16 02:07:24.1185856310 -0300" './PsQueue/PsQueue.txt' 85 | chown -h 1000:1000 './Tasks/1.Today' 86 | chmod 0777 './Tasks/1.Today' 87 | /usr/bin/touch -hcmd "2024-03-16 00:16:45.3815057020 -0300" './Tasks/1.Today' 88 | /usr/bin/touch -hcad "2024-03-16 02:00:25.6243832930 -0300" './Tasks/1.Today' 89 | chown -h 1000:1000 './Tasks/3.Events/Financial recovery/items/House/Cozy/Sandwiches/Atelie-peitoperuCremoso' 90 | chmod 0664 './Tasks/3.Events/Financial recovery/items/House/Cozy/Sandwiches/Atelie-peitoperuCremoso' 91 | /usr/bin/touch -hcmd "2024-03-15 23:50:00.2837060750 -0300" './Tasks/3.Events/Financial recovery/items/House/Cozy/Sandwiches/Atelie-peitoperuCremoso' 92 | /usr/bin/touch -hcad "2024-03-16 02:00:25.6323833350 -0300" './Tasks/3.Events/Financial recovery/items/House/Cozy/Sandwiches/Atelie-peitoperuCremoso' 93 | chown -h 1000:1000 './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/.folderstamp1' 94 | chmod 0664 './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/.folderstamp1' 95 | /usr/bin/touch -hcmd "2024-03-15 23:52:30.3219237090 -0300" './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/.folderstamp1' 96 | /usr/bin/touch -hcad "2024-03-16 02:00:35.4524350050 -0300" './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/.folderstamp1' 97 | chown -h 1000:1000 './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/Pitaya' 98 | chmod 0664 './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/Pitaya' 99 | /usr/bin/touch -hcmd "2024-03-15 23:53:24.2986990710 -0300" './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/Pitaya' 100 | /usr/bin/touch -hcad "2024-03-16 02:00:42.6484728680 -0300" './Tasks/3.Events/Financial recovery/items/House/Farm/Plants/Pitaya' 101 | .gitmeta-cid however: 102 | .meta/.folderstamp1: QmckwdcR3c9LHXUzHMKwnNWpN76KazdmLQhRew7vMKFqUN 103 | .meta/.folderstamp2: QmNQm94c9DteGPpFLuQUm7BEj5PVJjnRmA1pLtzaKokWqK 104 | .meta/Screenshot.png: QmViWwMCiYL4DqCMqoDnQnN5w1sKS6mfh6UDNoDhFZEbqD 105 | PsQueue/Draft_04-03-2024.txt: QmQgsykKJSPoNpfmFyCH8Ar7YjpWFNQRfbSkSaHEWzb9M5 106 | PsQueue/Draft_18-12-2023.txt: QmQrjSB4CurZKW1gc8WqwnWK7TsgcFsSHgKEydmuaXhqgM 107 | PsQueue/Draft_2023-1.txt: QmZjYC3CieSnofxnszcyJnGd7zCnarhAwsfhi2fDDSUB62 108 | PsQueue/Draft_2023-2.txt: QmaqSEiAU8YLrZXooo5CTFNzeydt6jKGtbTzRon3QUwDqX 109 | PsQueue/Draft_2023-3.txt: QmXSu8ey1PtoRad7A2p5m6QBK9MZ9JMtHwotXSVbRxYSpN 110 | PsQueue/Draft_21-12-2023.txt: QmWbtzJuJMYQA1bwABLG69ywMCeycBDmk57HRqdvN5X35j 111 | PsQueue/Draft_23-02-2024.txt: QmTzR5Zv2mmzH4ipybhsoc9AnD175TyvKEeTCcKZcnvtwE 112 | PsQueue/Draft_27-12-2023.txt: QmdrU1YWZgNKeA1ZqkTo864UumSb6Ts9UHAjdK1EQen8Bh 113 | PsQueue/Draft_29-01-2024.txt: QmaGi4DbJCfMd2HUF8gfMCaxnnf2c6NWZyvhPMkike8vpn 114 | PsQueue/Draft_anotherunknown.txt: QmWsuPK9GihNmup6ucJ46Uo7eUcN8tPcgkegzjLTGp8fbS 115 | PsQueue/Draft_find-tx+COMMIT.txt: Qmf9nKuo8MUmThK2BnxRKGZcZ5qSXv99D5FtDnHSXTcnrG 116 | PsQueue/Draft_findtx.txt: QmPpJWeFftX7NnvaXWGvwmtsyPbzKJKUjD7yXb3Kbg2G1s 117 | PsQueue/Draft_tamicopyrighting.txt: Qmd27oY1BTGbkBTpgDi9F2ax42XVuvV9tiiNpKzTjBGW9L 118 | PsQueue/Draft_unknown.txt: QmYvcUX7XZE2dnEmr2UaEv37bzC1LvwyVibJWJNArjfSKJ 119 | PsQueue/PsQueue.txt: QmWw6sYbiDbH7WRFhrAgXfqkpmJDr6msWcjPrhyTgQNjo1 120 | Tasks/1.Today: QmdogE9XSkn6YQrRGzAhmYeSjqvDdnrA8KCXwfak7XLDmc 121 | 122 | 123 | 124 | - before going on the next tasks: make this project in the "pla-woke-license", preventing use in projects related to ppl like Elon Musk; GPT+Bard should help write it in a conciser manner 125 | 126 | - https://github.com/gitcnd/git-meta.git: merge the latest commits /media/daniella/B/git/nerdy DAOs/01VCS/git-meta/to-merge 127 | 128 | -? init.sh: use /hooks folder rather than hardwriting! 129 | 130 | - init.sh: if no .git repo present, init using 01 131 | 132 | - test on Termux 133 | 134 | - detect if the repo's disk is incompatible with symlinks, so use cp instead of ln 135 | 136 | - 01 git-meta endgame: parse .git-meta and find tree files on it on every commit, then apply timestamps on checkout! - "git restore" should also restore file timestamps! (same for git checkout) 137 | 138 | - Better calc of each contributors' added lines/code. As seen here: https://github.com/01VCS/git-meta/graphs/contributors. So, make better credit commits, with all automatic code, attributed to each author, from the original gist. 139 | -------------------------------------------------------------------------------- /to-merge/git-meta.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | our $VERSION='0.20231111'; # Please use format: major_revision.YYYYMMDD[hh24mi] 4 | 5 | =head1 NAME 6 | 7 | git-meta.pl - solution for maintaining all the file dates, times, ownership, and access permissions in git 8 | .git/hooks/pre-commit - this same perl script, when it has the name "pre-commit" assumes you're running "git-meta.pl -save" 9 | .git/hooks/post-merge - this same perl script, when it has the name "post-merge" assumes you're running "git-meta.pl -restore" 10 | 11 | newgit.pl - this same perl script, when it has the name "newgit.pl", behaves as if the -newgit option was supplied - see below. 12 | 13 | =head1 SYNOPSIS 14 | 15 | 16 | # creates the pre-commit and post-merge hooks (see below) 17 | cd ~/myrepo 18 | git-meta.pl -setup -l /usr/local/bin/git-meta.pl 19 | -or- 20 | git-meta.pl -setup 21 | 22 | 23 | # Typically called from the pre-commit 24 | cd ~/myrepo 25 | git-meta.pl -save [optional list of files] 26 | 27 | 28 | # Typically called from post-merge 29 | cd ~/myrepo 30 | git-meta.pl -restore [optional list of files] 31 | 32 | 33 | # sets up your system to automatically extract files every time you push - handy for working on your own private mahcines, such as when maintaining web servers. 34 | newgit.pl ... see below 35 | 36 | Note: adds the file .git-meta to your project 37 | Recommend: set up .gitignore properly first 38 | 39 | =head2 OPTIONS 40 | 41 | -f # Specify the meta filename to use ( defaults to .git-meta ) 42 | -save # Save into the .git-meta. Saves all files if none are provided 43 | -restore # Restore from the .git-meta. Restores all files if none are provided 44 | -setup # create the necessary pre-commit and post-merge files to activate this solution in your repo 45 | -strict # Stop with errors instead of assume what the user wants (partially implimented) 46 | -dryrun # Show what would be done, without doing it (partially implimented) 47 | -debug # print everything going on 48 | -l # use a symlink when doing setup, for pre-commit and post-merge (e.g. -l /usr/local/bin/git-meta.pl) - otherwise - copies the file there. 49 | 50 | =head2 .git-meta file format 51 | 52 | # lines starting with # are comments 53 | octal file mode, owner, group, mtime, atime, spare1, spare2, filename 54 | 55 | =head2 known issues 56 | 57 | Only handles .gitignore files found inside your repo (not any set in your profile or elsewhere) 58 | 59 | 60 | 61 | 62 | =head1 NAME 63 | 64 | newgit.pl - create a new, optionally auto-extracting, private git repo, with preservation of file metadata (dates/time, permissions, ownership) 65 | -or- 66 | git-meta.pl -newgit 67 | 68 | =head1 SYNOPSIS 69 | 70 | newgit.pl gitname [optional-auto-extract-location] 71 | # creates gitname # this is where master files live. Uses $master_location/gitname unless gitname starts with / 72 | # creates ./gitname # this is a local working folder for editing your files etc (you can "git clone" more of these later) 73 | # maybe creates optional-auto-extract-location # this is where they'll be auto-extracted (properly includes mv/rm etc) upon all git push operations 74 | 75 | SCREW_UP_DATES=1 newgit.pl gitname [optional-auto-extract-location] 76 | # same as above, omitting the hooks which preserve dates/permissions/ownership 77 | 78 | DRYRUN=1 newgit.pl gitname [optional-auto-extract-location] 79 | DRYRUN=1 SCREW_UP_DATES=1 newgit.pl gitname [optional-auto-extract-location] 80 | # same as either of the above two, but doing nothing (shows what commands will be executed) 81 | 82 | =head2 Example 83 | 84 | newgit.pl leoweb ~/leo/public_html 85 | 86 | =head2 File location info 87 | 88 | if there's no "/" within "gitname", it will put the files into $master_location/gitname (e.g. ~/Downloads/gitblobs/gitname ) by default 89 | 90 | =cut 91 | ###################################################################### 92 | 93 | 94 | use bytes; # don't break UTF8 95 | use strict; 96 | use warnings; # same as -w switch above 97 | 98 | use POSIX; # for strftime 99 | use Time::HiRes; # Getting file microseconds 100 | use Getopt::Long; # Commandline argument parsing 101 | use Pod::Usage; # Inbuilt documentation helper 102 | my %gitignore; # global 103 | my %names;my $i=0;$names{$_}=$i++ foreach(qw(mode owner group mtime atime spare1 spare2 filename)); 104 | 105 | my $is_tty_out = (!-f STDOUT) && ( -t STDOUT && -c STDOUT); # -f is a file, -t is a terminal, -c is a character device 106 | my ($norm,$red,$grn,$yel,$nav,$blu,$save,$rest,$clr,$prp,$wht)=!$is_tty_out ? ('','','','','','','','','','','') : ("\033[0m","\033[31;1m","\033[32;1m","\033[33;1m","\033[34;1m","\033[36;1m","\033[s","\033[u","\033[K","\033[35;1m","\033[37;1m"); # so we can print colour output if we want. 107 | 108 | 109 | my %arg;&GetOptions('help|?' => \$arg{help}, # breif instructions 110 | 'f=s' => \$arg{gitmeta}, # meta filename 111 | 'save' => \$arg{save}, 112 | 'restore' => \$arg{restore}, 113 | 'strict' => \$arg{strict}, # stop instead of assume 114 | 'debug' => \$arg{debug}, 115 | 'setup' => \$arg{setup}, 116 | 'dryrun' => \$arg{dryrun}, # not full implimented! 117 | 'l=s' => \$arg{l}, 118 | 'newgit' => \$arg{newgit}, 119 | ) or &pod2usage(2); 120 | no warnings; 121 | &pod2usage(1) if ($arg{help}); # exits 122 | use warnings; 123 | $arg{gitmeta}=".git-meta" unless($arg{gitmeta}); 124 | $arg{dryrun}=$ENV{'DRYRUN'} unless($arg{dryrun}); # debugging - set the switch or env var to 1 if you want to print, but not execute, the commands 125 | my $dryrun=$arg{dryrun}; 126 | 127 | 128 | # Change the personality of this program, depending on what name $0 it has: 129 | if($0=~/pre-commit/) { 130 | $arg{save}=1; 131 | my @staged_files=`git diff --cached --name-only`; 132 | chomp(@staged_files); 133 | @staged_files=('.') unless(@staged_files); 134 | # warn "$blu doing:" . join("^",@staged_files) . "$norm\n"; 135 | # print "$blu doing:" . join("^",@staged_files) . "$norm\n"; 136 | @ARGV=@staged_files; 137 | } 138 | 139 | if($0=~/post-merge/) { 140 | $arg{restore}=1; 141 | @ARGV='.'; # do/check everything 142 | } 143 | 144 | if($0=~/newgit/) { 145 | $arg{newgit}=1; 146 | } 147 | 148 | 149 | 150 | 151 | 152 | 153 | ###################################################################### 154 | if($arg{newgit}) { 155 | 156 | # newgit settings 157 | 158 | my $master_location=$ENV{"HOME"}."/gitblobs"; # Change this to whatever default folder you want to use for storing master copies of files 159 | &do("mkdir -p $master_location") unless(-d $master_location); 160 | 161 | my $gitprog=''; open(IN,'<',$0) or die "Could not open file '$0' $!"; 162 | $gitprog.=$_ while(); 163 | close(IN); # Reads in ourself - for git-meta.pl to use 164 | my $hookfolder=''; 165 | 166 | $ARGV[0]='-' unless($ARGV[0]); # see next 167 | foreach(@ARGV){die "Usage:\t$0 gitname [optional-auto-extract-location]" if(/^-/);} # stop if they're confused 168 | my $gitblob=$ARGV[0]; $gitblob="$master_location/$ARGV[0]" unless($ARGV[0]=~/\//); 169 | die "Sorry, $gitblob exists" if(-e $gitblob); 170 | my $gitnamee=$ARGV[0]=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\s])/\\$1/rg; 171 | my $gitblobe=$gitblob=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\s])/\\$1/rg; # shell-escape for dummies who use spaces in filenames 172 | my $workblob=$ARGV[0]; 173 | my $workblobe=$ARGV[0]=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\s])/\\$1/rg; 174 | my $target=$ARGV[1] if($ARGV[1]); 175 | my $targete=$ARGV[1]=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\s])/\\$1/rg if($ARGV[1]); 176 | my $pwd=`pwd`=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\t ])/\\$1/rg;chomp($pwd); 177 | 178 | $workblobe="$pwd/$workblobe" unless($workblobe=~/^\//); 179 | $targete="$pwd/$targete" unless(!$target || $targete=~/^\//); 180 | 181 | &msg("# Create the master location"); 182 | &do("mkdir -p $gitblobe"); # ~/Downloads/gitblobs/foo 183 | &do("cd $gitblobe;git init --bare;cd $pwd"); 184 | 185 | # Set up auto-extract if wanted 186 | if($targete) { 187 | &msg("# Set up auto-extract into $targete"); 188 | my $targetee=$targete=~s/\\/\\\\/rg; 189 | if(!-e $targete){ 190 | &do("mkdir -p $targete") unless(-e $target); 191 | } else { 192 | print $red."Caution: '$target' exists: files in here will be overwritten by future 'git push' operations$norm\n"; 193 | } 194 | &do("cd $gitblobe/hooks/;cat >post-update <<\\EOF 195 | #!/bin/bash 196 | printf \"post-update: running...\\n\" 197 | env -u GIT_DIR git -C $targetee pull || exit 198 | printf \"post-update: ran ok $targetee\\n\" 199 | EOF"); 200 | &do("cd $gitblobe/hooks/;chmod -c +x post-update;cd $pwd"); 201 | &do("cd $targete;git clone $gitblobe; mv $gitnamee/.git .;rmdir $gitnamee;cd $pwd"); 202 | &do("touch $targete/AUTOGENERATED_FOLDER-DOT_NOT_EDIT"); 203 | 204 | unless($ENV{'SCREW_UP_DATES'}) { 205 | &msg("# Setting up '$target' to preserve dates"); 206 | # unless($gitprog) { $gitprog.=$_ while (); } # Reads from the end of this file 207 | my(@pfn)=&preserve_dates($target,$hookfolder,$gitprog); 208 | } 209 | 210 | } # targete 211 | 212 | &msg("# Create one initial working folder"); 213 | &do("mkdir -p $workblobe") if($workblobe); # ./foo 214 | &do("cd $workblobe;git clone $gitblobe; mv $gitnamee/.git .;rmdir $gitnamee;cd $pwd"); 215 | unless($ENV{'SCREW_UP_DATES'}) { 216 | &msg("# Setting up '$workblob' to preserve dates"); 217 | # unless($gitprog) { push $gitprog.=$_ while (); } # Reads from the end of this file 218 | my(@pfn)=&preserve_dates($workblob,$hookfolder,$gitprog); 219 | print($blu."If doing \"git clone\" in other machines later, remember to copy the following files into your new location .git/hooks/ folder too:\n\t".join("\n\t",@pfn)."$norm\n"); 220 | } 221 | 222 | 223 | &msg("# Done! Try these next perhaps:\ncd $ARGV[0]\necho hello>index.html\ngit add index.html\ngit commit -m Initial_Commit\ngit push" . ( $target? "\ndir $target" : "")); 224 | # Done! 225 | exit(0); 226 | } # newgit 227 | ###################################################################### 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | if($arg{setup}) { 238 | my $hookfolder='.git/hooks'; 239 | $hookfolder='hooks' unless(-d $hookfolder); 240 | die "No hooks folder: must run this from inside your repo folder." unless(-d $hookfolder); 241 | 242 | #my $gitprog=''; push $gitprog.=$_ while (); # Reads from the end of this file - for newgit to use 243 | # unless($gitprog) { push $gitprog.=$_ while (); } # Reads from the end of this file 244 | my $gitprog=''; open(IN,'<',$0) or die "Could not open file '$0' $!"; 245 | $gitprog.=$_ while(); 246 | close(IN); # Reads in ourself - for git-meta.pl to use 247 | &preserve_dates('.',$hookfolder,$gitprog); 248 | 249 | exit(0); 250 | } 251 | 252 | my(@meta,%meta); &LoadMeta($arg{gitmeta}); # Get existing metadata 253 | 254 | if($arg{save}) { 255 | &GetIgnore(); 256 | &GetMeta(undef,@ARGV); # Append new metadata to @meta 257 | &SaveMeta($arg{gitmeta}); # Write new metadata to file 258 | `git add $arg{gitmeta}` if($0=~/pre-commit/); # save the metadata with this commit too 259 | } elsif($arg{restore}) { 260 | &GetIgnore(); 261 | my @files=&GetMeta('nosave',@ARGV); # which files to restore 262 | &RestoreMeta(@files); # restore all or some file metadatas 263 | 264 | } else { 265 | &pod2usage(1); 266 | } 267 | 268 | 269 | 270 | # warn '%meta='. join("^",%meta); warn '@meta='. join("^",@meta); 271 | 272 | 273 | 274 | # Load the .gitignore file into a hash 275 | sub GetIgnore { 276 | $gitignore{'.git'}++ if(-e '.git'); # don't do the git blobs 277 | $gitignore{$arg{gitmeta}}++; # don't do our own metafile 278 | #$gitignore{'./.git'}++ if(-e '.git'); 279 | if(-e '.gitignore') { 280 | open(IN,'<','.gitignore') or die "open .gitignore: $!"; 281 | while() { 282 | chomp; $gitignore{$_}++; # $gitignore{"./$_"}++; 283 | } 284 | close(IN); 285 | } 286 | } # GetIgnore 287 | 288 | 289 | 290 | # Update @meta and %meta with metadata from a filesystem file or folder 291 | sub MetaFile { 292 | my($nosave,$filename)=@_; 293 | 294 | my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks)=Time::HiRes::lstat($filename); # the symlink itself, not the target 295 | 296 | # Retrieve specific file information 297 | my $permissions = sprintf "%04o", $mode & 07777; 298 | 299 | # Convert numeric user ID and group ID to names 300 | my $owner_name = getpwuid($uid); 301 | my $group_name = getgrgid($gid); 302 | 303 | my $microsecs_m=($mtime=~/(\.\d+)/)[0] // ""; # returns .456 or (if no decimal places) just "" 304 | my $humantime_m= strftime("%Y-%m-%d %H:%M:%S",localtime($mtime)) . $microsecs_m . strftime(" %z", localtime()) ; 305 | my $microsecs_a=($atime=~/(\.\d+)/)[0] // ""; # returns .456 or (if no decimal places) just "" 306 | my $humantime_a= strftime("%Y-%m-%d %H:%M:%S",localtime($atime)) . $microsecs_a . strftime(" %z", localtime()) ; 307 | # For later use thusly: touch -hcmd "2023-11-10 06:39:09.1234 +0000" filename 308 | 309 | my @fm=($permissions, $owner_name, $group_name, $humantime_m, $humantime_a,"","",$filename); 310 | 311 | return \@fm if($nosave); # restore-er made the call 312 | 313 | # warn join(",",@fm); 314 | # warn join(",",@{$meta[ $meta{$fm[-1]} ]}) if (defined $meta{$fm[-1]} ); 315 | 316 | if ( (! defined $meta{$fm[-1]}) || (join(",",@{$meta[ $meta{$fm[-1]} ]}) ne join(",",@fm) ) ) { 317 | push @meta,\@fm; # store everything in the original order inside an array 318 | $meta{$fm[-1]}=$#meta; # keep a searchable hash of the filenames as we go. This on-purpose will overwrite old duplicates with new times later. 319 | print "STORED: ARRAY $fm[-1] at index $#meta\n" if($arg{debug}); 320 | } else { 321 | print "Skipped unchanged file $fm[-1]\n" if($arg{debug}); 322 | } 323 | 324 | if(0 && $arg{debug}) { # Display the retrieved information 325 | print "File: $filename\n"; 326 | print "Permissions suitable for chmod: $permissions\n"; 327 | print "Owner: $owner_name\n"; 328 | print "Group: $group_name\n"; 329 | print "Last Modification Time (touch format): $mtime\n"; 330 | print "Last Modification Time (human + format): $humantime_m\n"; 331 | print "Last Access Time (touch format): $atime\n"; 332 | print "Last Access Time (human + format): $humantime_a\n"; 333 | print '(' . join(',',@fm) . ")\n"; 334 | } # debug 335 | 336 | return \@fm; 337 | } # MetaFile 338 | 339 | 340 | 341 | # Load a .git-meta file into @meta and %meta 342 | sub LoadMeta { 343 | my($metafile)=@_; 344 | if(!-f $metafile) { 345 | die "Expecting -f $metafile" if $arg{strict}; 346 | print STDERR $yel."Warning: no $metafile" . ($arg{save} ? " (it will be created next)" : "") . "$norm\n"; 347 | } else { 348 | open(IN,'<',$metafile) or die "$metafile: $!"; 349 | while() { 350 | chomp; 351 | my $fm=$_; 352 | unless(/^\s*#/) { 353 | my @fm=split(/,/,$_,8); $fm=\@fm; 354 | if (ref $meta{$$fm[-1]} && join(',',@{$meta{$$fm[-1]}}) eq $_) { 355 | $fm=undef; 356 | print "Skipping unchanged file info for $$fm[-1]\n" if($arg{debug}); 357 | } 358 | } 359 | push @meta,$fm; # store everything in the original order inside an array 360 | print "STORED: $fm at index $#meta\n" if($arg{debug}); 361 | $meta{$$fm[-1]}=$#meta if(ref $fm); # keep a searchable hash of the filenames as we go. This on-purpose will overwrite old duplicates with new times later. 362 | } 363 | close(IN); 364 | } 365 | } # LoadMeta 366 | 367 | 368 | 369 | # Write out (overwrite) our @meta and %meta into the .git-metafile, keeping original order 370 | sub SaveMeta { 371 | my($metafile)=@_; my %done; 372 | open(OUT,'>',$metafile) or die "write: $metafile: $!"; 373 | 374 | my $commit_author=`git config user.name`; chomp $commit_author; $commit_author .= ' <' . `git config user.email`; chomp $commit_author; $commit_author .= '> at ' . strftime("%Y-%m-%d %H:%M:%S %z",localtime()); 375 | 376 | # my $current_branch=`git rev-parse --abbrev-ref HEAD`; chomp $current_branch; 377 | 378 | print OUT "# octal file mode, owner, group, mtime, atime, spare1, spare2, filename\t# https://github.com/gitcnd/git-meta.git v$VERSION\n" if(ref $meta[0]); 379 | print OUT "# last: $commit_author\n" if(ref $meta[0]); 380 | 381 | for(my $i=0; $i<=$#meta;$i++) { 382 | # warn "i=$i"; warn "fn=" . $meta[$i]->[-1]; warn "idx=" . $meta{ $meta[$i]->[-1] }; 383 | if(!ref $meta[$i]) { # comment 384 | if($meta[$i]=~/^# last: /) { 385 | print OUT "# last: $commit_author\n"; # discard the old last: author remark 386 | } else { 387 | print OUT $meta[$i] . "\n"; 388 | } 389 | } elsif( !$done{$meta[$i]->[-1]}++ ) { # $meta{ $meta[$i]->[-1] }==$i ) # new or unchanged 390 | my $newest_i=$meta{ $meta[$i]->[-1] }; 391 | print OUT join(',',@{$meta[$newest_i]}) . "\n"; # "$meta[$i]->[-1]" is the filename, and the outer $meta{ } is the hash of the filename, which contains the @meta index number of the most recent info to use 392 | } else { 393 | print "Skipping appended $meta[$i]->[-1] at index $i because we earlier overwrote the older one from here: $meta{ $meta[$i]->[-1] }\n" if($arg{debug}); 394 | } 395 | } 396 | close(OUT); 397 | } # SaveMeta 398 | 399 | 400 | 401 | # Recursively spider the input set of files, calling MetaFile on them all to add them into @meta and %meta 402 | sub GetMeta { 403 | my ($nosave,@files) = @_; 404 | 405 | #warn join("^",@files); 406 | 407 | for(my $i=0; $i<=$#files;$i++) { 408 | my $f=$files[$i]; 409 | #warn "$i: $f"; 410 | if(-d $f) { 411 | opendir(my $dh, $f) or die "Could not open '$f' for reading: $!"; 412 | while (my $subfile = readdir($dh)) { 413 | next if $subfile eq '.' or $subfile eq '..'; 414 | push @files, ($f eq '.' ? $subfile : "$f/$subfile") unless($gitignore{$f} || $gitignore{"$f/$subfile"}); # || $f eq '.' ); 415 | } 416 | closedir($dh); 417 | } 418 | &MetaFile($nosave,$f) unless($nosave || $gitignore{$f} || $f eq '.'); # add file *and* folders to .git-meta @meta and %meta ram storage 419 | 420 | } # for 421 | return @files; 422 | } # GetMeta 423 | 424 | 425 | 426 | # restore metadata for the named files 427 | sub RestoreMeta { 428 | my (@files) = @_; 429 | my $fixed=0; 430 | 431 | foreach my $f (@files) { 432 | if( ! $meta{ $f } ) { 433 | print "No metadata for $f... skipping\n" if($arg{debug}); 434 | next; 435 | } 436 | 437 | my $nowfm=&MetaFile('nosave',$f); 438 | my $newfm=$meta[ $meta{ $f } ]; my $n; 439 | my $qmf=$f=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\s])/\\$1/rg; # shell-escape for dummies who use spaces in filenames 440 | 441 | if ( join(',',@$nowfm) ne join(',',@$newfm) ) { 442 | # mode owner group mtime atime spare1 spare2 filename 443 | 444 | $n='mode'; 445 | if( $nowfm->[$names{$n}] ne $newfm->[$names{$n}] ) { 446 | my $cmd="chmod $newfm->[$names{$n}] $qmf"; 447 | print "$grn$cmd$norm\n" if($arg{debug}); 448 | print $yel . `$cmd` . $norm unless($dryrun); 449 | } 450 | 451 | $n='owner'; 452 | if( $nowfm->[$names{$n}] ne $newfm->[$names{$n}] ) { 453 | my $cmd="chown $newfm->[$names{$n}] $qmf"; 454 | print "$grn$cmd$norm\n" if($arg{debug}); 455 | print $yel . `$cmd` . $norm unless($dryrun); 456 | } 457 | 458 | $n='group'; 459 | if( $nowfm->[$names{$n}] ne $newfm->[$names{$n}] ) { 460 | my $cmd="chgrp $newfm->[$names{$n}] $qmf"; 461 | print "$grn$cmd$norm\n" if($arg{debug}); 462 | print $yel . `$cmd` . $norm unless($dryrun); 463 | } 464 | 465 | $n='mtime'; 466 | if( $nowfm->[$names{$n}] ne $newfm->[$names{$n}] ) { 467 | my $cmd="touch -hcmd \"$newfm->[$names{$n}]\" $qmf"; 468 | print "$grn$cmd$norm\n" if($arg{debug}); 469 | print $yel . `$cmd` . $norm unless($dryrun); 470 | } 471 | 472 | $n='atime'; 473 | if( $nowfm->[$names{$n}] ne $newfm->[$names{$n}] && $f ne '.gitignore') { # we read this ourselves, so the atime always changes 474 | my $cmd="touch -hcad \"$newfm->[$names{$n}]\" $qmf"; 475 | print "$grn$cmd$norm\n" if($arg{debug}); 476 | print $yel . `$cmd` . $norm unless($dryrun); 477 | } 478 | $fixed++; 479 | } else { 480 | print "Skipping unchanged file $f\n" if($arg{debug}); 481 | } 482 | } 483 | return $fixed 484 | } # RestoreMeta 485 | 486 | 487 | # Caution: these subs msg and do in 3 places 488 | sub msg{ print "\n$wht$_[0]$norm\n"; } 489 | sub do { 490 | my($cmd)=@_; 491 | print "$grn$cmd$norm\n"; 492 | print $yel.`$cmd`.$norm unless($dryrun); 493 | } 494 | 495 | # CAUTION!! This code in 3 places (inside newgit.pl, and ALSO inside git-meta.pl and in the the pre-commit and post-merge DATA sections of newgit.pl) 496 | sub preserve_dates { 497 | my($base,$hookfolder,$gitprog)=@_; 498 | 499 | $hookfolder="$base/hooks" unless($hookfolder && -d $hookfolder); 500 | $hookfolder="$base/.git/hooks" unless(-d $hookfolder); 501 | die "No hooks folder ($hookfolder from ".`pwd`."): must run this from inside your repo folder." unless(-d $hookfolder); 502 | 503 | my $precommit="$hookfolder/pre-commit"; # $base/.git/hooks/pre-commit 504 | my $postmerge="$hookfolder/post-merge"; # $base/.git/hooks/post-merge 505 | 506 | # my $gitprog=''; push $gitprog.=$_ while (); # Reads from the end of this file 507 | if(!$dryrun) { 508 | if(-e $precommit) { 509 | print $yel."Caution: moved existing $precommit to $precommit.save$norm\n"; 510 | rename($precommit,"$precommit.save"); 511 | } 512 | if(-e $postmerge) { 513 | print $yel."Caution: moved existing $postmerge to $postmerge.save$norm\n"; 514 | rename($postmerge,"$postmerge.save"); 515 | } 516 | } 517 | 518 | if($arg{l}) { 519 | &do("ln -s $arg{l} $precommit"); 520 | } else { 521 | open(OUT,'>>',$dryrun ? '/dev/null' : $precommit) or die "Cannot create file '$precommit': $!"; 522 | print OUT $gitprog; close(OUT); 523 | } 524 | 525 | #commit_author="$(git config user.name)"" <""$(git config user.email)"">" 526 | #commit_message=$(cat $1) 527 | #current_branch=$(git rev-parse --abbrev-ref HEAD) #from https://dev.to/anibalardid/how-to-check-commit-message-and-branch-name-with-git-hooks-without-any-new-installation-n34 528 | #https://github.com/typicode/husky/discussions/1171 529 | 530 | # Get a list of all staged files 531 | #staged_files=$(git diff --cached --name-only) 532 | 533 | #bash .git/hooks/git-meta --store 534 | #git add .git-meta 535 | # echo "Done. Meta has been preserved!" 536 | 537 | my $precommite=$precommit=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\s])/\\$1/rg; 538 | &do("chmod ugo+x $precommite"); 539 | 540 | 541 | if($arg{l}) { 542 | &do("ln -s $arg{l} $postmerge"); 543 | } else { 544 | open(OUT,'>>',$dryrun ? '/dev/null' : $postmerge) or die "Cannot create file '$postmerge': $!"; 545 | print OUT $gitprog; close(OUT); 546 | } 547 | #q#!/bin/bash 548 | #echo "Restoring files' timestamp, CID/hash; and other files/commit's metadata..." 549 | #bash .git/hooks/git-meta -r 550 | #echo "Done. Meta has been restored!" 551 | 552 | my $postmergee=$postmerge=~s/([\$\#\&\*\?\;\|\>\<\(\)\{\}\[\]\"\'\~\!\\\s])/\\$1/rg; 553 | &do("chmod ugo+x $postmergee"); 554 | 555 | return($precommit,$postmerge); 556 | } # preserve_dates 557 | 558 | --------------------------------------------------------------------------------