To do a good traceability, one needs to show also the revision of the document that was used as a base.
To keep things simple, I can see multiple ways to uniquely identify the source document.
But, basically, once you get the document name, and the path to the repository, then you're in pretty good shape.
Would you accept a patch that adds a new option for a document to call a script that fetches the document identifier?
What I'm thinking is something like:
document FOOBAR
-path relative/path/my.doc
-getid relative/path/to/getid_script.sh
And then getid_script.sh should return a one-liner like any of:
my.doc git ab54cd78ef git://my.repo/hoge.git
https://my.server.internal/trunk/path/to/my.doc r12345
version 1.2.3 r4567 @server
or any other corresponding arbitrary few-line script.
The result would be like

To do a good traceability, one needs to show also the revision of the document that was used as a base.
To keep things simple, I can see multiple ways to uniquely identify the source document.
But, basically, once you get the document name, and the path to the repository, then you're in pretty good shape.
Would you accept a patch that adds a new option for a document to call a script that fetches the document identifier?
What I'm thinking is something like:
And then
getid_script.shshould return a one-liner like any of:my.doc git ab54cd78ef git://my.repo/hoge.githttps://my.server.internal/trunk/path/to/my.doc r12345version 1.2.3 r4567 @serveror any other corresponding arbitrary few-line script.
The result would be like
