{"thread":{"id":"17059","subject":"git-cache-meta -- simple file meta data caching and applying","startedAt":"2009-01-09T00:13:15Z","lastAt":"2009-01-10T17:43:29Z","messageCount":6,"participants":["jidanni@jidanni.org","Jay Soffian","Boyd Stephen Smith Jr."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"99751","messageId":"87hc49jq04.fsf@jidanni.org","threadId":"17059","inReplyTo":null,"subject":"git-cache-meta -- simple file meta data caching and applying","fromName":"","fromEmail":"jidanni@jidanni.org","sentAt":"2009-01-09T00:13:15Z","receivedAt":"2009-01-09T00:13:15Z","isPatch":false,"sender":{"key":"jidanni@jidanni.org","avatar":"https://gravatar.com/avatar/36568d4af4c8d3e71627ef3b8c8d00e39065b12f29676cccd38ced75e68fa2a6?d=mp&s=160"},"body":"Gentlemen, I have whipped up this:\n\n#!/bin/sh -e\n#git-cache-meta -- simple file meta data caching and applying.\n#Simpler than etckeeper, metastore, setgitperms, etc.\n: ${GIT_CACHE_META_FILE=.git_cache_meta}\ncase $@ in\n    --store|--stdout)\n\tcase $1 in --store) exec > $GIT_CACHE_META_FILE; esac\n\tfind $(git ls-files) \\\n\t    \\( -user ${USER?} -o -printf 'chowm %u %p\\n' \\) \\\n\t    \\( -group $USER -o -printf 'chgrp %g %p\\n' \\) \\\n\t    \\( \\( -type l -o -perm 755 -o -perm 644 \\) -o -printf 'chmod %#m %p\\n' \\);;\n    --apply) sh -e $GIT_CACHE_META_FILE;;\n    *) 1>&2 echo \"Usage: $0 --store|--stdout|--apply\"; exit 1;;\nesac\n"},{"id":"99754","messageId":"76718490901081622q618c43d0t333882cbe44f6b30@mail.gmail.com","threadId":"17059","inReplyTo":"87hc49jq04.fsf@jidanni.org","subject":"Re: git-cache-meta -- simple file meta data caching and applying","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-01-09T00:22:25Z","receivedAt":"2009-01-09T00:22:25Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Thu, Jan 8, 2009 at 7:13 PM,  <jidanni@jidanni.org> wrote:\n> Gentlemen, I have whipped up this:\n>\n> #!/bin/sh -e\n> #git-cache-meta -- simple file meta data caching and applying.\n> #Simpler than etckeeper, metastore, setgitperms, etc.\n> : ${GIT_CACHE_META_FILE=.git_cache_meta}\n> case $@ in\n>    --store|--stdout)\n>        case $1 in --store) exec > $GIT_CACHE_META_FILE; esac\n>        find $(git ls-files) \\\n>            \\( -user ${USER?} -o -printf 'chowm %u %p\\n' \\) \\\n>            \\( -group $USER -o -printf 'chgrp %g %p\\n' \\) \\\n>            \\( \\( -type l -o -perm 755 -o -perm 644 \\) -o -printf 'chmod %#m %p\\n' \\);;\n>    --apply) sh -e $GIT_CACHE_META_FILE;;\n>    *) 1>&2 echo \"Usage: $0 --store|--stdout|--apply\"; exit 1;;\n> esac\n\nIt doesn't handle paths which contain white-space. \"chown\" is typo'd\nas \"chowm\". To be useful, the contribution might also include\ninstructions on how it should be used with git, and perhaps also\nreasoning for why someone would want to use it in place of etckeeper,\nmetastore, setgitperms, etc.\n\nj.\n"},{"id":"99757","messageId":"76718490901081628x62da43bcia5cdbb160b0ff24a@mail.gmail.com","threadId":"17059","inReplyTo":"76718490901081622q618c43d0t333882cbe44f6b30@mail.gmail.com","subject":"Re: git-cache-meta -- simple file meta data caching and applying","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-01-09T00:28:18Z","receivedAt":"2009-01-09T00:28:18Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Thu, Jan 8, 2009 at 7:22 PM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> It doesn't handle paths which contain white-space. \"chown\" is typo'd\n> as \"chowm\". To be useful, the contribution might also include\n> instructions on how it should be used with git, and perhaps also\n> reasoning for why someone would want to use it in place of etckeeper,\n> metastore, setgitperms, etc.\n\nIt will also blow-up if the output of \"git ls-files\" exceeds\nlimitations on number of arguments. Also, might be worth mentioning it\nrequires GNU find.\n\nj.\n"},{"id":"99760","messageId":"878wpljiq9.fsf@jidanni.org","threadId":"17059","inReplyTo":"76718490901081628x62da43bcia5cdbb160b0ff24a@mail.gmail.com","subject":"Re: git-cache-meta -- simple file meta data caching and applying","fromName":"","fromEmail":"jidanni@jidanni.org","sentAt":"2009-01-09T02:50:22Z","receivedAt":"2009-01-09T02:50:22Z","isPatch":false,"sender":{"key":"jidanni@jidanni.org","avatar":"https://gravatar.com/avatar/36568d4af4c8d3e71627ef3b8c8d00e39065b12f29676cccd38ced75e68fa2a6?d=mp&s=160"},"body":"Fixed. Manly the program aims to be tiny. Perhaps I should include a\nfull example of using it with git-bundle.\n\n#!/bin/sh -e\n#git-cache-meta -- file meta data caching for possible use with\n#git-bundle, git-fast-export, git-archive, hooks, as a simple\n#alternative to etckeeper, metastore, setgitperms. Requires GNU Find.\n: ${GIT_CACHE_META_FILE=.git_cache_meta}\ncase $@ in\n    --store|--stdout)\n\tcase $1 in --store) exec > $GIT_CACHE_META_FILE; esac\n\tgit ls-files|xargs -I{} find {} \\\n\t    \\( -user ${USER?} -o -printf 'chown %u \"%p\"\\n' \\) \\\n\t    \\( -group $USER   -o -printf 'chgrp %g \"%p\"\\n' \\) \\\n\t    \\( \\( -type l -o -perm 755 -o -perm 644 \\) \\\n\t\t\t      -o -printf 'chmod %#m \"%p\"\\n' \\);;\n    --apply) sh -e $GIT_CACHE_META_FILE;;\n    *) 1>&2 echo \"Usage: $0 --store|--stdout|--apply\"; exit 1;;\nesac\n"},{"id":"99761","messageId":"200901082229.46433.bss@iguanasuicide.net","threadId":"17059","inReplyTo":"87hc49jq04.fsf@jidanni.org","subject":"Re: git-cache-meta -- simple file meta data caching and applying","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-01-09T04:29:45Z","receivedAt":"2009-01-09T04:29:45Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Thursday 08 January 2009, jidanni@jidanni.org wrote \nabout 'git-cache-meta -- simple file meta data caching and applying':\n>Gentlemen, I have whipped up this:\n>\n>#!/bin/sh -e\n>#git-cache-meta -- simple file meta data caching and applying.\n>#Simpler than etckeeper, metastore, setgitperms, etc.\n\nYou *might* look at pristine-tar from Debian.  It's specifically designed \nto be able to generate the .orig.tar.gz that Debian packages are based on \nfrom a VCS checkout, but it's code might be useful.\n\nI do like your script though.  It's simple and the output is plain text so \nit is easy to have your VCS maintain it.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"99912","messageId":"87eizb12gu.fsf_-_@jidanni.org","threadId":"17059","inReplyTo":"200901082229.46433.bss@iguanasuicide.net","subject":"[PATCH] git-cache-meta -- file owner and permissions caching, minimalist approach","fromName":"","fromEmail":"jidanni@jidanni.org","sentAt":"2009-01-10T17:43:29Z","receivedAt":"2009-01-10T17:43:29Z","isPatch":true,"sender":{"key":"jidanni@jidanni.org","avatar":"https://gravatar.com/avatar/36568d4af4c8d3e71627ef3b8c8d00e39065b12f29676cccd38ced75e68fa2a6?d=mp&s=160"},"body":"Signed-off-by: jidanni <jidanni@jidanni.org>\n---\n contrib/metadata/git-cache-meta |   19 +++++++++++++++++++\n 1 files changed, 19 insertions(+), 0 deletions(-)\n create mode 100755 contrib/metadata/git-cache-meta\n\ndiff --git a/contrib/metadata/git-cache-meta b/contrib/metadata/git-cache-meta\nnew file mode 100755\nindex 0000000..5e1b740\n--- /dev/null\n+++ b/contrib/metadata/git-cache-meta\n@@ -0,0 +1,19 @@\n+#!/bin/sh -e\n+# git-cache-meta -- file owner and permissions caching, minimalist approach\n+: ${GIT_CACHE_META_FILE=.git_cache_meta} #simpler not to git-add it\n+case $@ in\n+    --store|--stdout)\n+\tcase $1 in --store) exec > $GIT_CACHE_META_FILE; esac\n+\tgit ls-files|xargs -I{} find {} \\\n+\t    \\( -user ${USER?} -o -printf \"chown %u '%p'\\n\" \\) \\\n+\t    \\( -group $USER -o -printf \"chgrp %g '%p'\\n\" \\) \\\n+\t    \\( \\( -type l -o -perm 755 -o -perm 644 \\) \\\n+\t\t\t-o -printf \"chmod %#m '%p'\\n\" \\);;#requires GNU Find\n+    --apply) sh -e $GIT_CACHE_META_FILE;;\n+    *) 1>&2 cat <<EOF; exit 1;;\n+Usage: $0 --store|--stdout|--apply #Example:\n+# git bundle create mybundle.bdl master; git-cache-meta --store\n+# scp mybundle.bdl .git_cache_meta machine2: #then on machine2:\n+# git init; git pull mybundle.bdl master; git-cache-meta --apply\n+EOF\n+esac\n-- \n1.6.0.6\n"}]}