From b37d9708ad84dfa19ae40d878f9d354855072fa9 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 31 Oct 2019 16:40:03 +1300 Subject: [PATCH] add vcsh post-init hook to seed gitignore --- .../vcsh/hooks-available/post-init.write-gitignore | 11 +++++++++++ .config/vcsh/hooks-enabled/post-init.write-gitignore | 1 + .gitignore.d/vcsh | 2 ++ 3 files changed, 14 insertions(+) create mode 100755 .config/vcsh/hooks-available/post-init.write-gitignore create mode 120000 .config/vcsh/hooks-enabled/post-init.write-gitignore diff --git a/.config/vcsh/hooks-available/post-init.write-gitignore b/.config/vcsh/hooks-available/post-init.write-gitignore new file mode 100755 index 0000000..012db00 --- /dev/null +++ b/.config/vcsh/hooks-available/post-init.write-gitignore @@ -0,0 +1,11 @@ +#!/bin/sh + +cd $GIT_WORK_TREE + +GIT_IGNORE_FILE=.gitignore.d/$VCSH_REPO_NAME + +touch $GIT_IGNORE_FILE +git add -f $GIT_IGNORE_FILE +vcsh write-gitignore $VCSH_REPO_NAME +git add $GIT_IGNORE_FILE +git commit -m'seed gitignore file' diff --git a/.config/vcsh/hooks-enabled/post-init.write-gitignore b/.config/vcsh/hooks-enabled/post-init.write-gitignore new file mode 120000 index 0000000..23224f2 --- /dev/null +++ b/.config/vcsh/hooks-enabled/post-init.write-gitignore @@ -0,0 +1 @@ +../hooks-available/post-init.write-gitignore \ No newline at end of file diff --git a/.gitignore.d/vcsh b/.gitignore.d/vcsh index 8cda741..10bb4ea 100644 --- a/.gitignore.d/vcsh +++ b/.gitignore.d/vcsh @@ -1,2 +1,4 @@ * +!/.config/vcsh/hooks-available/post-init.write-gitignore +!/.config/vcsh/hooks-enabled/post-init.write-gitignore !/.gitignore.d/vcsh -- 2.39.5