Closed dennisobrien closed 3 years ago
If I manually create this empty file before installing, I don't see an error.
$ mkdir -p ~/.config/git
$ touch ~/.config/git/attributes
$ nbstripout --install --global
I'm not sure if the file ~/.config/git/attributes
not existing is a bug with my git setup, or if nbstripout
should be modified to create the file if it doesn't exist. I'm happy to make a PR if you have an opinion about how best to handle this.
The ${HOME}/.config/git
directory isn't created by default in a Git installation. The error is essentially the same error one would get doing the following:
echo '...' > "${HOME}/.config/git/attributes
nbstripout
should create the ${HOME}/.config/git
directory (and any missing parent directories) if they don't exist (e.g. mkdir -p "${HOME}/.config/git"
)
Thanks for reporting this. That is indeed a regression and nbstripout
should be creating this directory if needed.
I'm implementing the convention document in man gitattributes
btw.:
If you wish to affect only a single repository (i.e., to assign attributes to files that are particular to one user’s workflow for that repository), then attributes should be placed in the
$GIT_DIR/info/attributes
file. Attributes which should be version-controlled and distributed to other repositories (i.e., attributes of interest to all users) should go into.gitattributes
files. Attributes that should affect all repositories for a single user should be placed in a file specified by thecore.attributesFile
configuration option (seegit-config(1)
). Its default value is$XDG_CONFIG_HOME/git/attributes
. If$XDG_CONFIG_HOME
is either not set or empty,$HOME/.config/git/attributes
is used instead. Attributes for all users on a system should be placed in the$(prefix)/etc/gitattributes
file.
I am trying to install nbstripout git integrations globally but I get an error finding the file
~/.config/git/attributes
.Is this attribute file expected to exist already? I would expect it to be using the file
~/.gitconfig
based on the docs.This is on MacOS 10.15.7