The sound distributed version control system

#307 pijul-ls: Add a command to list all untracked files

Opened by fogti on February 10, 2021 Reviewing
fogti on February 10, 2021

Currently, there seems to be no way to get a list of all untracked files besides the following, impractical way:

cd $REPO_ROOT
pijul record
pijul add -r .
pijul diff --short

I propose the addition of an option --negate (alternatives: --invert or simply --untracked) to pijul ls to show a list of all untracked files instead of a list of all tracked files. Future possibilities: This would make it possible for the user to create a shortcut status command equivalent to that command of darcs (darcs status).

Alphare on February 12, 2021

+1 for adding a status command. pijul ls is more like a hg files or git ls-files, and both Mercurial and git have a status command that is used very frequently.

We’re currently rewriting hg status to be faster and more robust, so don’t hesitate to ping me on the matter, hopefully I can help guide some of the discussion.

pmeunier on August 4, 2021

Thanks for the suggestion! pijul diff --short now does this, with U as a prefix.

pijul diff --short is still a bit slow, since it computes a full diff of modified files, whereas only a checksum comparison would be enough to show a change.

pmeunier closed this discussion on August 4, 2021
Alphare on August 4, 2021

Note that a checksum comparison would still be very slow. I’ve spent the last 2 years optimizing the Mercurial status, in Rust no less, so we could probably reuse some of the logic. :)

fogti on August 4, 2021

I would really like if it could get implemented into ls by only doing a comparison on the directory tree level instead of the file level, because that could be done much faster in a majority of use cases, I suppose. It wouldn’t even need a checksum comparison, just a comparison between the output of pijul ls and find . | sed -e '^s#./##g'

fogti reopened this discussion on August 4, 2021
pmeunier on December 7, 2021

@zseri I’m not sure I understand your request here, do you mean you don’t like the name of pijul diff --untracked and would prefer something related to pijul ls instead?

pmeunier added tag Reviewing on December 7, 2021
fogti on December 8, 2021

My request is basically a performance optimization for the cases where the content of the untracked files is uninteresting or extremely big (think of e.g. big compiled executables, or log traces, that the user might want to exclude), where the list of files which are untracked but not ignored is the only thing that matters. (and it would take a long amount of time for pijul diff --untracked to finish, or it would clutter the terminal output and possible scroll out important messages, when called without proper additional filtering)