Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git-cache-meta
#!/bin/sh -e
#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
# - save all files metadata not only from other users
# - save numeric uid and gid
# 2012-03-05 - added filetime, andris9
: ${GIT_CACHE_META_FILE=.git_cache_meta}
case $@ in
--store|--stdout)
case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
find $(git ls-files)\
\( -printf 'chown %U %p\n' \) \
\( -printf 'chgrp %G %p\n' \) \
\( -printf 'touch -c -d "%AY-%Am-%Ad %AH:%AM:%AS" %p\n' \) \
\( -printf 'chmod %#m %p\n' \) ;;
--apply) sh -e $GIT_CACHE_META_FILE;;
*) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;
esac

source:

git-cache-meta --store

destination:

git-cache-meta --apply

Download jgit.sh

Config

cat > ~/.jgit
accesskey: aws access key
secretkey: aws secret access key
<Ctrl-D>

Setup repo

git remote add origin amazon-s3://.jgit@bucket.name/repo-name.git

Push

jgit push origin master

Clone

jgit clone amazon-s3://.jgit@bucket.name/repo-name.git

Pull

jgit fetch
git merge origin/master
@Explorer09
Copy link

Explorer09 commented Feb 24, 2014

Edited the version above, I think this should be the best way to handle unusual filenames in git source tree.
You need GNU versions of "find", "xargs", and "ls" of course.
Note the other changes made by me:

  • 'touch' commands are moved to the bottom.
  • File modification time and access time are stored separately.
  • 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.)
  • Added '-h' switch to chown and chgrp. This allows the script to handle symlinks.
  • 'chmod' only if the file is not a symlink.
  • 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.
: ${GIT_CACHE_META_FILE=.git_cache_meta}

if [ -n "$(find -prune -printf '%Tz %Az\n' | tr -d ' 0-9+-')" ]; then
echo "%z not supported in 'strftime' in C library." >&2
exit 1
fi

case $@ in
    --store|--stdout)
    case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
    git ls-files -z | xargs -0 -I NAME find NAME \
        \( -printf 'chown -h %U ' -exec ls --quoting-style=shell '{}' \; \) , \
        \( -printf 'chgrp -h %G ' -exec ls --quoting-style=shell '{}' \; \) , \
        \( \! -type l -printf 'chmod %#m ' -exec ls --quoting-style=shell '{}' \; \) , \
        \( -printf 'touch -c -h -m -d "%TY-%Tm-%Td %TH:%TM:%TS %Tz" ' -exec ls --quoting-style=shell '{}' \; \) , \
        \( -printf 'touch -c -h -a -d "%AY-%Am-%Ad %AH:%AM:%AS %Az" ' -exec ls --quoting-style=shell '{}' \; \) ;;
    --apply) sh -e $GIT_CACHE_META_FILE;;
    *) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;
esac

@the-mars
Copy link

the-mars commented Mar 18, 2014

Edited the version above to store directory metadata too. Useful if you for example want to add some www-data writable directories.

#!/bin/sh -e

#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
#modified by the-mars
# - save all files metadata not only from other users
# - save numeric uid and gid
#2012-03-05 - added filetime, andris9
#2012-05-22 - added fix for non ASCII characters and list size, merge chgrp into chown command
#2014-03-18 - the-mars: store properties for dirs too

pIFS=$IFS
IFS='
'

: ${GIT_CACHE_META_FILE=.git_cache_meta}

if [ -n "$(find -prune -printf '%Tz %Az\n' | tr -d ' 0-9+-')" ]; then
echo "%z not supported in 'strftime' in C library." >&2
exit 1
fi

case $@ in
    --store|--stdout)
    case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
    git ls-files -z | sed -z -r 's~/[^/]+$~~' | uniq -z | xargs -0 -I NAME find NAME \
        \( -printf 'chown -h %U:%G ' -exec ls -d --quoting-style=shell '{}' \; \) , \
        \( \! -type l -printf 'chmod %#m ' -exec ls -d --quoting-style=shell '{}' \; \) , \
        \( -printf 'touch -c -h -m -d "%TY-%Tm-%Td %TH:%TM:%TS %Tz" ' -exec ls -d --quoting-style=shell '{}' \; \) , \
        \( -printf 'touch -c -h -a -d "%AY-%Am-%Ad %AH:%AM:%AS %Az" ' -exec ls -d --quoting-style=shell '{}' \; \)
    git ls-files -z | xargs -0 -I NAME find NAME \
        \( -printf 'chown -h %U:%G ' -exec ls --quoting-style=shell '{}' \; \) , \
        \( \! -type l -printf 'chmod %#m ' -exec ls --quoting-style=shell '{}' \; \) , \
        \( -printf 'touch -c -h -m -d "%TY-%Tm-%Td %TH:%TM:%TS %Tz" ' -exec ls --quoting-style=shell '{}' \; \) , \
        \( -printf 'touch -c -h -a -d "%AY-%Am-%Ad %AH:%AM:%AS %Az" ' -exec ls --quoting-style=shell '{}' \; \) ;;
    --apply) sh -e $GIT_CACHE_META_FILE;;
    *) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;
esac

IFS=$pIFS

@pvdputte
Copy link

pvdputte commented May 16, 2014

With regard to the version by the-mars above: the -z option for sed is not available in e.g. Debian 7 Wheezy... (sed 4.2.1) :-(
It is in Ubuntu 14.04 (sed 4.2.2).

@delormec
Copy link

delormec commented May 20, 2014

Great script.
I needed to add a space before the \ on this line though:
find $(git ls-files)\

@JPT77
Copy link

JPT77 commented Nov 30, 2014

Well. It's getting complex. For me it did not really work.
If anyone has got trouble too, I recommend using: https://github.com/przemoc/metastore
Metastore seems to have some plans for the future.

btw. would be nice to put this script into a repo.

@Ubaldo79
Copy link

Ubaldo79 commented Feb 4, 2015

I also don't have the -z option available in sed (I am using MinGw for Windows) :-(
Any workaround?

@PeterMosmans
Copy link

PeterMosmans commented Mar 13, 2015

@Barzi2001,
Yes: use MSYS2 with its up-to-date version of mingw(64) and sed (currently at 4.2.2, so -z is supported)

Hope that helps...

@danny0838
Copy link

danny0838 commented Apr 17, 2015

Here's a quick fix for the-mars' version:

  • Fix time zone detection. Use date +%z as a fallback if find -print %Tz gets an unset (empty) result.
  • Add ./ prefix for file names to prevent a leading-dash-name issue (rare, though; just in case).
  • Add -maxdepth 0 to avoid deeper find if a file/directory happens to be inexist.
  • Use awk post-replace to improve performance (by reducing mass ls calls).
  • Use git ls-tree to list all git versioned directories to improve performance and to avoid potential errors ("some.file" is added as a directory; "aaa/bbb/ddd.txt" doesn't make "aaa" added). This also eliminates the "No sed -z in MsysGit" issue since we no more use sed -z.
  • Merge short options.
#!/bin/sh -e

#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
#modified by the-mars
# - save all files metadata not only from other users
# - save numeric uid and gid
#2012-03-05 - added filetime, andris9
#2012-05-22 - added fix for non ASCII characters and list size, merge chgrp into chown command
#2014-03-18 - the-mars: store properties for dirs too
#2015-04-17 - time zone offset fallback; fix leading-dash-name error; avoid deeper find;
#              better quote file names; better directory listing; merge short opts; by Danny Lin

: ${GIT_CACHE_META_FILE=.git_cache_meta}
: ${Tz:=$(find -prune -printf '%Tz')}
: ${Tz:=$(date +%z)}
if ! [ "$Tz" ]; then
    echo "%z not supported in 'strftime' in C library." >&2
    exit 1
fi

case $@ in
    --store|--stdout)
    case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
    { git ls-tree --name-only -rdz $(git write-tree) | xargs -0 -I NAME find ./NAME -maxdepth 0 \
        \( -printf 'chown -h %U:%G \0%p\n' \) , \
        \( \! -type l -printf 'chmod %#m \0%p\n' \) , \
        \( -printf 'touch -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
        \( -printf 'touch -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
      git ls-files -z | xargs -0 -I NAME find ./NAME -maxdepth 0 \
        \( -printf 'chown -h %U:%G \0%p\n' \) , \
        \( \! -type l -printf 'chmod %#m \0%p\n' \) , \
        \( -printf 'touch -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
        \( -printf 'touch -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
    } | awk 'BEGIN {FS="\0"}; {print $1 "'\''" gensub(/'\''/, "'\''\\\\'\'''\''", "g", $2) "'\''" }' ;;
    --apply) sh -e $GIT_CACHE_META_FILE;;
    *) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;
esac

MsysGit (1.9.5) doesn't seem to support chown, chgrp, and touch -h, just remove them to be compatible. e.g.:

@@ -25,15 +25,13 @@
     --store|--stdout)
     case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
     { git ls-tree --name-only -rdz $(git write-tree) | xargs -0 -I NAME find ./NAME -maxdepth 0 \
-        \( -printf 'chown -h %U:%G \0%p\n' \) , \
         \( \! -type l -printf 'chmod %#m \0%p\n' \) , \
-        \( -printf 'touch -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
-        \( -printf 'touch -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
+        \( -printf 'touch -cmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
+        \( -printf 'touch -cad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
       git ls-files -z | xargs -0 -I NAME find ./NAME -maxdepth 0 \
-        \( -printf 'chown -h %U:%G \0%p\n' \) , \
         \( \! -type l -printf 'chmod %#m \0%p\n' \) , \
-        \( -printf 'touch -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
-        \( -printf 'touch -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
+        \( -printf 'touch -cmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
+        \( -printf 'touch -cad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
     } | awk 'BEGIN {FS="\0"}; {print $1 "'\''" gensub(/'\''/, "'\''\\\\'\'''\''", "g", $2) "'\''" }' ;;
     --apply) sh -e $GIT_CACHE_META_FILE;;
     *) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;

MsysGit don't support find -print %Tz, either. However, while it supports date +%z, my patch with this fallback works.

Still another issue is that MsysGit doesn't support touch using a timestamp with fractional seconds. If the repo works only on MsysGit, it would work fine since MsygGit's %TS and %AS writes no fractional seconds. However if the .git_cache_meta has been created on a system that writes fractional seconds, an error would occur when it's being applied on MsysGit.

Many platforms and softwares just ignore the fractional seconds. To make the script more platform-free, we could add a replace command to pre-exclude the fractional seconds. For example:

@@ -34,7 +34,8 @@
         \( \! -type l -printf 'chmod %#m \0%p\n' \) , \
         \( -printf 'touch -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
         \( -printf 'touch -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
-    } | awk 'BEGIN {FS="\0"}; {print $1 "'\''" gensub(/'\''/, "'\''\\\\'\'''\''", "g", $2) "'\''" }' ;;
+    } | awk 'BEGIN {FS="\0"}; {print $1 "'\''" gensub(/'\''/, "'\''\\\\'\'''\''", "g", $2) "'\''" }' |
+        sed -r 's!^(touch -[a-z]* "[0-9 :+\-]+)(\.[0-9]+)? !\1 !';;
     --apply) sh -e $GIT_CACHE_META_FILE;;
     *) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;
 esac

@bizonix
Copy link

bizonix commented May 7, 2015

for Mac OS X, brew install findutils gawk coreutils

#!/bin/sh -e

#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
#modified by the-mars
#modified by bizonix
# - save all files metadata not only from other users
# - save numeric uid and gid
#2012-03-05 - added filetime, andris9
#2012-05-22 - added fix for non ASCII characters and list size, merge chgrp into chown command
#2014-03-18 - the-mars: store properties for dirs too
#2015-04-17 - time zone offset fallback; fix leading-dash-name error; avoid deeper find;
#              better quote file names; better directory listing; merge short opts; by Danny Lin
#2015-05-07 - for Mac OS X, `brew install findutils gawk coreutils`

: ${GIT_CACHE_META_FILE=.git_cache_meta}

if [[ "$OSTYPE" == "darwin"* ]]; then
    GNU='g'
fi
for bin in find touch awk ; do
    BIN=$( echo $bin | tr '[:lower:]' '[:upper:]')
    eval ': ${'$BIN':=$(which $GNU$bin)}'
    if [ "$GNU" == 'g' ] && ! [[ "${!BIN}" =~ /$GNU$bin ]]  ; then
        echo "gnu version of '$bin' file not found." >&2
        exit 1
    fi
done

: ${Tz:=$($FIND -prune -printf '%Tz')}
: ${Tz:=$(date +%z)}
if ! [ "$Tz" ]; then
    echo "%z not supported in 'strftime' in C library." >&2
    exit 1
fi

case $@ in
    --store|--stdout)
    case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
    { git ls-tree --name-only -rdz $(git write-tree) | xargs -0 -I NAME $FIND ./NAME -maxdepth 0 \
        \( -printf 'chown -h %U:%G \0%p\n' \) , \
        \( \! -type l -printf 'chmod %#m \0%p\n' \) , \
        \( -printf $TOUCH' -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
        \( -printf $TOUCH' -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
      git ls-files -z | xargs -0 -I NAME $FIND ./NAME -maxdepth 0 \
        \( -printf 'chown -h %U:%G \0%p\n' \) , \
        \( \! -type l -printf 'chmod %#m \0%p\n' \) , \
        \( -printf $TOUCH' -hcmd "%TY-%Tm-%Td %TH:%TM:%TS '$Tz'" \0%p\n' \) , \
        \( -printf $TOUCH' -hcad "%AY-%Am-%Ad %AH:%AM:%AS '$Tz'" \0%p\n' \)
    } | $AWK 'BEGIN {FS="\0"}; {print $1 "'\''" gensub(/'\''/, "'\''\\\\'\'''\''", "g", $2) "'\''" }' ;;
    --apply) sh -e $GIT_CACHE_META_FILE;;
    *) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;
esac

@arno01
Copy link

arno01 commented Oct 19, 2015

Hi all,
Thanks to everyone for great additions above!
I decided to share my version of this script. The idea is to keep it as simple as possible.

#!/bin/sh -e

# git-cache-meta -- simple file meta data caching and applying.
# Simpler than etckeeper, metastore, setgitperms, etc.
# from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
# modified by n1k
#  - save all files metadata not only from other users
#  - save numeric uid and gid

# Changes by: Andrey Arapov <andrey.arapov@nixaid.com>
#   2015-10-16 - add '-h' flag to chown, chgrp and touch so that symlink is
#                NOT followed
#              - chmod cannot be applied to symlink
#              - add "--" to stop processing arguments (e.g when file name has
#                leading "-")
#   2015-10-14 - added quotes around path %p

# Initial release by andris9
#   2012-03-05 - added filetime, andris9

: ${GIT_CACHE_META_FILE=.git_cache_meta}
case $@ in
    --store|--stdout)
    case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
    find $(git ls-files)\
        \( -printf 'chown -h %U -- "%p"\n' \) \
        \( -printf 'chgrp -h %G -- "%p"\n' \) \
        \( -printf 'touch -h -c -d "%AY-%Am-%Ad %AH:%AM:%AS" -- "%p"\n' \) \
        ! -type l \( -printf 'chmod %#m -- "%p"\n' \) ;;
    --apply) sh -e $GIT_CACHE_META_FILE;;
    *) 1>&2 echo "Usage: $0 --store|--stdout|--apply"; exit 1;;
esac

@heaversm
Copy link

heaversm commented Dec 30, 2015

This is failing for me on a mac, since mac does not seem to support the -printf parameter.

@cmw
Copy link

cmw commented Jan 5, 2016

@heaversm: arno01's version doesn't work for me either, but bizonix' does.

@danny0838
Copy link

danny0838 commented Jun 8, 2016

I created another project git-store-meta, which is written in Perl and a bit more complicated but has better performance, flexibility, security, and cross-platform compatibility, while it still keeps very light dependency.

@undergroundSimplex
Copy link

undergroundSimplex commented Jun 2, 2020

@danny0838's work is great, exception from that I would change chown -h %U:%G to chown -h %u:%g in case that UID and GID is different for the same user/group on different machine

@danny0838
Copy link

danny0838 commented Jun 3, 2020

@undergroundSimplex: Thank you for the feedback. I agree with you. It's actually the behavior that git-store-meta has implemented.

@xspython
Copy link

xspython commented Jun 23, 2021

../git-cache-meta.sh --store
find: 'usr/lib/firmware/brcm/brcmfmac43430a0-sdio.ONDA-V80': No such file or directory
find: 'PLUS.txt': No such file or directory
find: 'usr/lib/firmware/brcm/brcmfmac43455-sdio.MINIX-NEO': No such file or directory
find: 'Z83-4.txt': No such file or directory
find: 'usr/lib/python3.6/site-packages/setuptools/command/launcher': No such file or directory
find: 'manifest.xml': No such file or directory
find: 'usr/lib/python3.6/site-packages/setuptools/script': No such file or directory
find: '(dev).tmpl': No such file or directory

ls usr/lib/firmware/brcm/brcmfmac43430a0-sdio.ONDA-V80\ PLUS.txt
'usr/lib/firmware/brcm/brcmfmac43430a0-sdio.ONDA-V80 PLUS.txt'

@danimesq
Copy link

danimesq commented Oct 16, 2021

It is wonderful the collaboration level the humans can naturally organize 🥰
@andris9 have started this and y'all started appending into it, respecting/including the previous contributions
All of that not on a git repository, but providing a frugal way into a gist!

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 with all of your contributions! 🎉🥳 (🎊 look like a beach bikini)

https://github.com/Floflis/git-meta

@AntonioMeireles @brayrobert201 @stefanbj @Explorer09 @Cojad @the-mars @mkortleven-emg @danny0838 @bizonix

Sorry @arno01 for not including yours, as it seemed very incomplete and @cmw reported it didn't worked.

@danimesq
Copy link

danimesq commented Oct 16, 2021

Also mentioning other participants who may have interest: @kickiss @pvdputte @delormec @JPT77 @Barzi2001 @PeterMosmans @heaversm @undergroundSimplex @xspython

@andris9
Copy link
Author

andris9 commented Oct 16, 2021

Completely forgot that this thing even exists 😀

@danny0838
Copy link

danny0838 commented Oct 16, 2021

Though it's nice to have revisions integrated, I have been shifted to git-store-meta for many years, as it's much more performant, secure, and supports more features. 😅

@Explorer09
Copy link

Explorer09 commented Oct 16, 2021

Hello @DaniellMesquita,
Thanks for integrating the code, but I didn't have time at the moment to test the new one out.
However at the first glance of the new code, it seems like it does not meet the portability that I expected yet. The first issue I found is that your version includes bashisms and the shebang line says /bin/sh and not /bin/bash. Either the script should be POSIX compatible, or it should use /bin/bash as the shebang.
If I see another issue, I might report it later.

@danimesq
Copy link

danimesq commented Oct 16, 2021

@andris9

Completely forgot that this thing even exists 😀

Congrats on starting this project.
If in the future there is a layer2 for git, for sure this will be as useful as it was for me when I was needing.

@danny0838

Though it's nice to have revisions integrated, I have been shifted to git-store-meta for many years, as it's much more performant, secure, and supports more features. 😅

Haven't heard of it. Could you share?

@Explorer09

Thanks for integrating the code, but I didn't have time at the moment to test the new one out.
However at the first glance of the new code, it seems like it does not meet the portability that I expected yet. The first issue I found is that your version includes bashisms and the shebang line says /bin/sh and not /bin/bash. Either the script should be POSIX compatible, or it should use /bin/bash as the shebang.

Despite looking very bashy, it works with a simple ./git-meta.sh --store

Should I still change?

If I see another issue, I might report it later.

Thank you. You're very welcome, as the first to report issues when this project has been started.

@danny0838
Copy link

danny0838 commented Oct 16, 2021

@DaniellMesquita As above mentioned.

@danimesq
Copy link

danimesq commented Oct 17, 2021

@danny0838

If you port it from Perl to Rust, then I'll switch to it.

@danny0838
Copy link

danny0838 commented Oct 17, 2021

@DaniellMesquita I don't write Rust. Even if I do, I won't recommend that.

The purpose of using Perl is because Perl is a component of Git core (normally) and must be supported by any platform that can run Git.

Using another famous language will inevitably introduce an additional dependency and make installation more difficult.

@Explorer09
Copy link

Explorer09 commented Oct 17, 2021

@DaniellMesquita As I said, either make the script POSIX compatible or use /bin/bash as the shebang.
Not everyone uses bash as the default shell and you can run into compatibility problems.
Which choice to make is up to you. It's your project so you can make up your own policy.

@danimesq
Copy link

danimesq commented Oct 17, 2021

@danny0838

The purpose of using Perl is because Perl is a component of Git core (normally) and must be supported by any platform that can run Git.

Using another famous language will inevitably introduce an additional dependency and make installation more difficult.

It makes sense.

Will git-store-meta support git hooks to automatically version changes in file metadata on every commit?

@danimesq
Copy link

danimesq commented Oct 17, 2021

@Explorer09

As I said, either make the script POSIX compatible or use /bin/bash as the shebang.
Not everyone uses bash as the default shell and you can run into compatibility problems.
Which choice to make is up to you. It's your project so you can make up your own policy.

Democracy is way better than seeing this community effort as "my project".

Done: 01VCS/git-meta@810d5ff

And issues/PRs are welcome.

@danny0838
Copy link

danny0838 commented Oct 18, 2021

@DaniellMesquita

Will git-store-meta support git hooks to automatically version changes in file metadata on every commit?

Yes. Read the manual for details, bro.

@danimesq
Copy link

danimesq commented Oct 18, 2021

@danny0838

Yes. Read the manual for details, bro.

Interesting. An native version, in the same language as git, makes more sense.

Although I'll personally stick with the sh/bash version for simplicity (and for diversification).

Now it can be initiated in a repo for performing metadata versioning on every commit: 01VCS/git-meta@cf30ef0 (automatically)

Next step, maybe, is having an individual git repository for the metadata, inside .git/meta (will make things more organized and magical)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment