I recommend folks set this explicitly, but Greg Wilson wanted a way
for folks to use update-copyright without having to tweak this name
after forking [1]. The approach I've used here isn't the same as the
one discussed in that issue (using the name of the upstream Git
repository), but I think it's a better choice. Pros and cons:
+ Simple, VCS-agnostic implementation
+ Doesn't make assumptions about the upstream repository naming
- Assumes folks name their local repository appropriately
- Won't handle several projects stored in the same Git repository For
example, if you have a branch for project-a and another for
project-b that are both in your local project-a repository, you'll
have to explicitly set project.name in the project-b branch's
.update-copyright.conf.
[1]: https://github.com/swcarpentry/lesson-template/pull/197#discussion_r26456407
project/name
A string naming your project. Replaces ``{project}`` in your
- copyright blurbs.
+ copyright blurbs. If this isn't set, ``update-copyright`` will fall
+ back to using the name of the repository directory.
project/vcs
The name of your version control system.
files/authors
project = parser['project']
except KeyError:
project = {}
- self._name = project.get('name')
+ self._name = project.get('name', _os_path.basename(self._root))
vcs = project.get('vcs')
kwargs = {
'root': self._root,