Comments (7)
making mount
add (".", path)
to an EvalMap
solves the mount issue without causing join/etc to break things
from hlink.
note that this would make it possible to create dependencies within a mount operation, e.g.
./source/ -> dest/
extern -> source/file
which, if reversed, causes issues.
the reverse can be made just as easily as the above layout, in fact join
almost encourages you to reverse the above since it doesn't follow symlinks.
from hlink.
perhaps join should prepend its additions? I don't like it but it might turn out to encourage valid setups
from hlink.
alternatively I could detect invalid setups
from hlink.
perhaps instead of an alternate mark, I should make an alternate join specifically for pulling a .links through a symbolic link?
I think it would only pull the line specifying the link itself out of the file, the rest would remain?
from hlink.
I'm going to add a second version of Join, JoinLink, which is designed to behave well when pulling a .links through a symbolic link.
This means two things,
one is that it can be used in combination with MountRelative to create internal symlinks (i.e. relative sources will change to refer to the link being Joined)
the other is that it will be possible to Join a link whose target is inside another link, after that link has been added to the .links
i.e. the following
source/ -> dest/
$location/file -> source/file
should be possible to make without typing anything.
This means:
- Relative sources should be updated with respect to the link being joined
- If a line has a relative source and a relative destination then the relative destination should be updated with respect to the target of that link (for directories treat them as links to themselves)
- Otherwise relative destinations should be updated with respect to the link itself.
- Absolute sources and destinations including compressed paths should stay absolute.
from hlink.
So there are 6 situations that can occur in a .link
being JoinLink
ed:
. -> <relative>
<relative> -> <relative>
<absolute> -> <relative>
. -> <absolute>
<relative> -> <absolute>
<absolute> -> <absolute>
no. 1 should become link/ -> target/<relative>
because target -> target/<relative>
is nonsensical.
no. 2 should become link/<relative> -> link/relative
as:
target/<relative> -> target/<relative>
can be achieved using a normaljoin
,target/<relative> -> link/<relative>
can as welllink/<relative> -> target/<relative>
can be achieved using MarkReverse (described later) via no. 3/4
no. 3 should become<absolute> -> link/<relative>
for similar reasons as apply to no. 2
numbers 4-6 should all belink/... -> <absolute>
although in some situations may become a relative path to the new root.
So the actual rules are:
Always use the link location for updating relative paths, with the exception of <a> -> <a>/<b>
, i.e. when the destination is inside the source, in which case the target is used for updating the destination, and the link is used for updating the source.
By adding MarkReverse, which instead of adding <cd>
to a .links
, adds . -> <cd>
, most internal link patterns (perhaps all?) become possible in combination with JoinLink.
MarkRelative may be useful still, though it is a compressed equivalent to MarkReverse.
I suspect I won't add MarkRelative simply to avoid clutter.
from hlink.
Related Issues (17)
- compresspaths thinks long directory names are nested in short ones
- create intermediate directories during mount
- Unnecessary binary duplication HOT 1
- tool for recompressing a .links
- readme - .hLink is messy
- Inconsistent keywords dotLink and dotLinks
- case sensitive path compression
- readme - Describe admin requirements of mount on windows
- fix make
- in Locations getLocalPaths could be combined with locationsBySize HOT 1
- clean paths before passing them to OS commands
- clear old symlinks when mounting
- detect and link to files too HOT 1
- use directory package for all file searching
- create tool for editing path index
- Mark should add newline
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hlink.