Previously when the program name had a trailing slash, `conf` would not
find the right file as it would check for filenames that include a slash
(e.g. `prog/rc`). This was especially annoying, since conf's completion
function inserts a slash automatically when subdirectories exists.
The hook was never added since the `functions` array was misspelled. I
fixed that and left it turned on the last few days and absolutely hate
it. No idea why I ever thought that this could be nice.
Only difference is that it places a trailing slash behind (empty)
directory names to differentiate them better. bfs does this already.
TODO: Bring these together into one function that checks $0
Replace custom awk solution with uniq, by first flipping filename and
filesize so that uniq's `-f` flag can be utilized (as there is no
inverse of it, i.e. "only look at field n").
This increases performance by quite a bit.
This reverts commit 226f09b046.
I don't want to have relative links all the time.
TODO: If target is a relative path, make the link relative too
TODO: Support --relative flag
This makes it possible to diff command chains. For example:
diffcmds git format-patch -1 --stdout HEAD~ '|' \
grep '^%%' '|' \
cut -c2- \
-- - +
to see if a commit only reordered lines without modifying them.
I am not happy with this solution and would prefer a different form of
escaping (e.g. with %).
Use the byte size as first filter instead of the size in 1KB blocks.
This way the filter is way more accurate and filters out more files
for which the md5sum does not need to be calculated.
Previously when filenames contained spaces, the function would break as
`awk {print $2,$1}` would only print a part of the filename.
The field swap was used as a workaround so that `uniq` only compares the
sizes, and `uniq` unfortunately only has a flag to **skip** fields.
Fix this issue by using a short awk script that mimics `uniq` but only
with the first field (i.e. the size).
My awk foo is unfortunately not very good, and that is why the one-liner
prints out the first duplicated line multiple time. The `sort -u` pipe
afterwards gets rid of those.