Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide files/dirs #183

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

hide files/dirs #183

wants to merge 8 commits into from

Conversation

ezrizhu
Copy link
Collaborator

@ezrizhu ezrizhu commented Nov 3, 2024

example: ./try -E STYLE.md -n "ls"

TODO

  • Impl
  • tests
  • resolve issue on /tmp
  • resolve CI failure
  • manpages & usage

@ezrizhu ezrizhu changed the title [WIP]basic impl [WIP] hide files/dirs Nov 3, 2024
@ezrizhu
Copy link
Collaborator Author

ezrizhu commented Nov 3, 2024

current issue: try -E fails when the dir is in /tmp

λ cat /tmp/tmp.hjwJDZxAyD.try-1730616101765
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/efi: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/nix: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/run: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/run/user/1000/doc: permission denied.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/sys: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/tmp: mount(2) system call failed: Too many levels of symbolic links.
       dmesg(1) may have more information after failed mount system call.

specifically: mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/tmp: mount(2) system call failed: Too many levels of symbolic links.

temp curr resolution: setting mktemp to use another dir

@ezrizhu ezrizhu self-assigned this Nov 3, 2024
ezrizhu and others added 5 commits January 11, 2025 02:26
Closes #185.

Try was making way too many tempfiles. Now we store everything in the sandbox, with a tiny bit of nuance: $IGNORE_FILE needs to be created in advance to handle the args properly. So we create that temporary unconditionally. When running a command (the try() function), we'll move $IGNORE_FILE into the sandbox. When running try commit or try summary, we just delete $IGNORE_FILE at the end.
@ezrizhu ezrizhu changed the title [WIP] hide files/dirs hide files/dirs Jan 13, 2025
@ezrizhu ezrizhu requested a review from mgree January 13, 2025 14:55
try
@@ -645,6 +666,11 @@ do
fi
LOWER_DIRS="$OPTARG"
NO_COMMIT="quiet";;
(E) if [ -n "$EXCL_ENTS" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not allow this to work like -i, where you can specify multiple ignores on the command-line?

@mgree
Copy link
Contributor

mgree commented Jan 15, 2025

current issue: try -E fails when the dir is in /tmp

What is the actual command that causes this failure?

λ cat /tmp/tmp.hjwJDZxAyD.try-1730616101765
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/efi: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/nix: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/run: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/run/user/1000/doc: permission denied.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/sys: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/tmp: mount(2) system call failed: Too many levels of symbolic links.
       dmesg(1) may have more information after failed mount system call.

specifically: mount: /tmp/tmp.x51LCKay3K.try-1730616101765/temproot/tmp: mount(2) system call failed: Too many levels of symbolic links.

temp curr resolution: setting mktemp to use another dir

Is this a 'resolution' or a workaround? Seems like a workaround.

If the failure is just when -E mentions a dir under /tmp, we should warn/error about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants