gittup/tup — pull request #122 by Rendaw (2013-06-21 18:15:19+00:00)
Title: Use root-relative paths in parse-traversal related errors/tracebacks

Since they were closely related, I stuck two changes in here.
1. I made the traceback and tup tree traversal related errors use root-relative paths.
2. I added a lua function that returns a root-relative path given a (valid) relative path within the tup tree.

I described my rationale for point 1 in #118.

For 2, this has been something I wanted for a while but I can't remember why at the moment. One reason I wanted it was to implement include guards, which requires absolute path names for included files for comparison purposes. I managed to do it with getcwd() and some regexp's, but it was pretty painful.

Another reason I was thinking it would be helpful is for emulating variants: either by putting the tupfiles in the variant directory and defining inputs based on the current root-relative-path minus the variant directory prefix, or, if extradirectory outputs are supported, by defining outputs based on the current root-relative-path plus the variant directory prefix.

In any case, I think 2 is helpful for debugging tupfiles, path logic, etc.