ls tricks for git-annex?

martin f krafft madduck at madduck.net
Sat Sep 27 15:15:34 CEST 2014


also sprach martin f krafft <madduck at madduck.net> [2014-09-26 13:00 +0200]:
>   myls() {
>     local usecolor; usecolor=never
>     [ -t 1 ] && usecolor=always
>     ls --color=$usecolor "$@" |
>       while read line; do
>         case "$line" in
>           (*-\> *.git/annex/objects/*)
>             echo "@${${line#l}% ->*}";;
>           (*)
>             echo "$line";;
>         esac
>       done
>   }

After some experimentation, I have to confess that this won't work.
The above is fine, but you get the mode and filesize of the link,
not the reference. Trying to dereference in the loop works, but
messes up the output as /bin/ls aligns columns…

Does anyone have any experience with LD_PRELOAD? Theoretically one
should be able to inject a readdir() that dereferences git-annex
links, right?

-- 
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
 
"marriage is the only adventure open to the cowardly."
                                                           -- voltaire
 
spamtraps: madduck.bogus at madduck.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: digital_signature_gpg.asc
Type: application/pgp-signature
Size: 1107 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
URL: <http://lists.madduck.net/pipermail/vcs-home/attachments/20140927/aa398f78/attachment.sig>


More information about the vcs-home mailing list