You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From within the project root directory, we want to annotate file1.py using the custom template proj.jinja2.
$ cd <path>/proj
$ reuse annotate --copyright=John --license=CC0-1.0 --template=proj file1.py
Successfully changed header of file1.py
So far so good.
However, suppose we also want to annotate file2 within subdir.
$ cd <path>/proj
$ cd subdir
$ reuse annotate --copyright=John --license=CC0-1.0 --template=proj file2.py
reuse annotate: error: template ../proj could not be found
To have it work, he have to move up to the root directory
$ cd <path>proj
$ reuse annotate --copyright=John --license=CC0-1.0 --template=proj subdir/file2.py
Successfully changed header of file2.py
Intriguingly, I have another project which was cloned from a remote Git repository where the problem does not occur, which led me to wonder if the issue had something to do with proj not being a git repo. However, I then recreated proj as a Git repo, cloned it and repeated the tests only to check that the problem persists.
As a note, I performed some debugging in reuse-tool source and could see that for my working project, the program correctly detects the project root dir (.. if I invoke reuse from a first-level subdir) , while for proj, the program identifies the project root as the absolute path <path>proj/subidr. I could not dig deeper in the problem, though.
The text was updated successfully, but these errors were encountered:
Oof… Using reuse from subdirectories is one of those things that requires quite a bit of plumbing, but doesn't have nearly enough in the way of tests. It's a bit of a mess, especially because there are two types of relative paths:
Relative from project root
Relative from CWD
These are normally identical, but not always, and the bug here is probably something of that type.
Would anyone confirm or provide hints on the following issue.
Suppose that the project directory has the following structure:
From within the project root directory, we want to annotate
file1.py
using the custom templateproj.jinja2
.So far so good.
However, suppose we also want to annotate
file2
withinsubdir
.To have it work, he have to move up to the root directory
Intriguingly, I have another project which was cloned from a remote Git repository where the problem does not occur, which led me to wonder if the issue had something to do with
proj
not being a git repo. However, I then recreatedproj
as a Git repo, cloned it and repeated the tests only to check that the problem persists.As a note, I performed some debugging in
reuse-tool
source and could see that for my working project, the program correctly detects the project root dir (..
if I invoke reuse from a first-level subdir) , while forproj
, the program identifies the project root as the absolute path<path>proj/subidr
. I could not dig deeper in the problem, though.The text was updated successfully, but these errors were encountered: