diff --git a/README.md b/README.md index df4d65e..c218d60 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ You may already have these files in the `.githooks/` directory, since they may h If you already have those files, you only need to add the syntax to run the `gitattributesdb` script to each of those hook files. Add the following in an appropriate place in those 3 files: ``` -.githooks/gitattributsdb/gitattributsdb "${0##*/}" +.githooks/gitattributesdb/gitattributesdb "${0##*/}" ``` If those files do not already exist, you need to create and activate them: @@ -60,7 +60,7 @@ each file: #!/usr/bin/env bash # Store/restore the attributes of files: -.githooks/gitattributesdb/gitattributsdb "${0##*/}" +.githooks/gitattributesdb/gitattributesdb "${0##*/}" ``` Save the changes to each file. @@ -120,13 +120,13 @@ Tracking Extra Files This is useful, for example, to track the attributes of `/etc/shadow`, without checking that file itself into git (and thus storing sensitive data in a potentially publicly accessible git repository). -To achieve this, the path to the file (relative to the root of the git repository) must be added to a special file, `.gitattributsdb-extra`, which should +To achieve this, the path to the file (relative to the root of the git repository) must be added to a special file, `.gitattributesdb-extra`, which should be placed in the root of the repository. To add files to the "extra" files database, use: ``` -printf "%s" "" | base64 -w 0 >>.gitattributsdb-extra +printf "%s" "" | base64 -w 0 >>.gitattributesdb-extra ``` Where `` is a file relative to the repository root. -Old files (that no longer exist on the filesystem) stored in the `.gitattributsdb-extra` file are ignored when commiting. +Old files (that no longer exist on the filesystem) stored in the `.gitattributesdb-extra` file are ignored when commiting. diff --git a/gitattributsdb b/gitattributesdb similarity index 96% rename from gitattributsdb rename to gitattributesdb index cbebc47..e5a9596 100755 --- a/gitattributsdb +++ b/gitattributesdb @@ -5,9 +5,9 @@ # Licensed under the terms of the GNU General Public License version 3. # Defaults. -DB_FILE=".gitattributsdb" # Database file, relative to the repository root. -DB_EXTRA=".gitattributsdb-extra" # List of base64 encoded filenames (one per line) to also store/restore attributes for. - # To add entries to this file, use: printf "%s" "" | base64 -w 0 >>.gitattributsdb-extra +DB_FILE=".gitattributesdb" # Database file, relative to the repository root. +DB_EXTRA=".gitattributesdb-extra" # List of base64 encoded filenames (one per line) to also store/restore attributes for. + # To add entries to this file, use: printf "%s" "" | base64 -w 0 >>.gitattributesdb-extra # Where '' is relative to the repository root. # Variables. @@ -87,7 +87,7 @@ store_attributes() { [[ "$PLATFORM" == "Darwin" ]] && warn "Not storing ACLs or xattrs on Darwin" # File header. - printf "# %s\\n" "This is the gitattributsdb database file." >"$DB_TMP" + printf "# %s\\n" "This is the gitattributesdb database file." >"$DB_TMP" printf "# %s\\n\\n" "Do not manually edit this file - any changes will be overwritten." >>"$DB_TMP" # Create the database.