Skip to content

list: show symlink targets (for tar and zip)#934

Merged
marcospb19 merged 13 commits intoouch-org:mainfrom
tommady:close-issue-932
Apr 22, 2026
Merged

list: show symlink targets (for tar and zip)#934
marcospb19 merged 13 commits intoouch-org:mainfrom
tommady:close-issue-932

Conversation

@tommady
Copy link
Copy Markdown
Contributor

@tommady tommady commented Mar 5, 2026

close: #932

Signed-off-by: tommady <tommady@users.noreply.github.com>
Copy link
Copy Markdown
Member

@marcospb19 marcospb19 left a comment

Choose a reason for hiding this comment

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

Hey sorry for the eager review but what if is_dir and symlink_target get collapsed into one field for an enum for file type.

Regular and Directory unit variants
Symlink tuple variant with PathBuf inside.

so you express in the type system that symlink_target can't be some while is_dir is true.

wdyt

@tommady
Copy link
Copy Markdown
Contributor Author

tommady commented Mar 6, 2026

Hey sorry for the eager review but what if is_dir and symlink_target get collapsed into one field for an enum for file type.

Regular and Directory unit variants Symlink tuple variant with PathBuf inside.

so you express in the type system that symlink_target can't be some while is_dir is true.

wdyt

No worries at all,
I appreciate the suggestion!

I agree this is a great idea.
Collapsing is_dir and symlink_target into a single enum would model the state much more clearly and lets the type system enforce that a symlink target can’t exist while the entry is a directory.

tommady added 2 commits March 6, 2026 03:52
Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
@tommady tommady marked this pull request as ready for review March 6, 2026 05:27
@tommady
Copy link
Copy Markdown
Contributor Author

tommady commented Mar 6, 2026

Hey @marcospb19,

I added support for hard links in the tar archive as well. This goes slightly beyond the scope of the original issue, so feel free to let me know if you’d prefer to keep the change more minimal.

For now, I made hard links display the same way as symlinks because I wasn’t sure what the best visual distinction would be (I’m definitely not a UI/UX designer 🤪).

Whenever you have time, I’d appreciate a review.

Thanks!

Comment thread src/list.rs Outdated
Comment thread src/list.rs Outdated
Signed-off-by: tommady <tommady@users.noreply.github.com>
@marcospb19 marcospb19 changed the title let tar and zip can print symlink target list: show symlink targets (for tar and zip) Mar 11, 2026
@tommady tommady requested a review from marcospb19 March 25, 2026 09:25
@marcospb19
Copy link
Copy Markdown
Member

Wait I accidentally pushed something directly to main 🤦, let me solve this conflict.

Copy link
Copy Markdown
Member

@marcospb19 marcospb19 left a comment

Choose a reason for hiding this comment

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

lgtm!

Comment thread src/archive/zip.rs
tommady added 2 commits April 22, 2026 03:13
Signed-off-by: tommady <tommady@users.noreply.github.com>
@tommady tommady requested a review from marcospb19 April 22, 2026 03:30
Copy link
Copy Markdown
Member

@marcospb19 marcospb19 left a comment

Choose a reason for hiding this comment

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

Yay thanks

For the changelog I'll later figure out an automation later so you don't have to do this manually xD.

Merging

@marcospb19 marcospb19 merged commit f69fcc6 into ouch-org:main Apr 22, 2026
18 checks passed
@tommady tommady deleted the close-issue-932 branch April 22, 2026 21:57
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.

ouch list should show symlink targets for supported formats

2 participants