Fix typos: gitattributs -> gitattributes. Thanks to roped.

This commit is contained in:
Darren 'Tadgy' Austin 2024-06-03 18:17:41 +01:00
commit 70cfe11629
2 changed files with 9 additions and 9 deletions

View file

@ -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. 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: 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: If those files do not already exist, you need to create and activate them:
@ -60,7 +60,7 @@ each file:
#!/usr/bin/env bash #!/usr/bin/env bash
# Store/restore the attributes of files: # Store/restore the attributes of files:
.githooks/gitattributesdb/gitattributsdb "${0##*/}" .githooks/gitattributesdb/gitattributesdb "${0##*/}"
``` ```
Save the changes to each file. 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 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). 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. be placed in the root of the repository.
To add files to the "extra" files database, use: To add files to the "extra" files database, use:
``` ```
printf "%s" "<filename>" | base64 -w 0 >>.gitattributsdb-extra printf "%s" "<filename>" | base64 -w 0 >>.gitattributesdb-extra
``` ```
Where `<filename>` is a file relative to the repository root. Where `<filename>` 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.

View file

@ -5,9 +5,9 @@
# Licensed under the terms of the GNU General Public License version 3. # Licensed under the terms of the GNU General Public License version 3.
# Defaults. # Defaults.
DB_FILE=".gitattributsdb" # Database file, relative to the repository root. DB_FILE=".gitattributesdb" # 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. 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" "<filename>" | base64 -w 0 >>.gitattributsdb-extra # To add entries to this file, use: printf "%s" "<filename>" | base64 -w 0 >>.gitattributesdb-extra
# Where '<filename>' is relative to the repository root. # Where '<filename>' is relative to the repository root.
# Variables. # Variables.
@ -87,7 +87,7 @@ store_attributes() {
[[ "$PLATFORM" == "Darwin" ]] && warn "Not storing ACLs or xattrs on Darwin" [[ "$PLATFORM" == "Darwin" ]] && warn "Not storing ACLs or xattrs on Darwin"
# File header. # 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" printf "# %s\\n\\n" "Do not manually edit this file - any changes will be overwritten." >>"$DB_TMP"
# Create the database. # Create the database.