Skip to content

Fix --relative-paths flag for Source Trees section header#62

Merged
sammcj merged 3 commits intomainfrom
copilot/fix-absolute-paths-issue
Jan 18, 2026
Merged

Fix --relative-paths flag for Source Trees section header#62
sammcj merged 3 commits intomainfrom
copilot/fix-absolute-paths-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 17, 2026

The --relative-paths flag was not applied to the Source Trees section header, causing absolute paths to appear even when relative paths were requested throughout the rest of the output.

Changes

  • main.go: Conditionally use filepath.Base(absPath) for tree headers when --relative-paths is set
    • Applies to both directory and single file processing paths

Behavior

# Before (with --relative-paths)
Source Trees:
/home/user/project/app:
app/
├── Console/

# After (with --relative-paths)
Source Trees:
app:
app/
├── Console/

The fix ensures consistent relative path usage across the entire output when the flag is enabled.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • openaipublic.blob.core.windows.net
    • Triggering command: ./ingest ./ingest --output /tmp/output_absolute.md --no-clipboard /tmp/test_ingest/app pkg/mod/github.c-errorsas .cfg rg/[email protected] 01.o 02.o 03.o rg/[email protected] 05.o�� -20240827094217--p 6759422/b260/ rg/[email protected]=go1.25 -p github.com/fatih--norc l/linux_amd64/as--noprofile rg/[email protected]/bXVO6ZUVP7qSYLbH8Mzx (dns block)
    • Triggering command: ./ingest ./ingest --relative-paths --output /tmp/output_relative.md --no-clipboard /tmp/test_ingest/app .cfg rg/[email protected] 6759422/b260/ -I ctor rg/toolchain@v0./tmp/go-build1816759422/b335/vet.cfg -o -20240827094217-dd81d9e9be82/bash [email protected] rg/[email protected] -p dutil/randutil.g--norc l/linux_amd64/co--noprofile rg/[email protected]/tmp/go-build1816759422/b177/ (dns block)
    • Triggering command: /home/REDACTED/work/ingest/ingest/ingest /home/REDACTED/work/ingest/ingest/ingest --relative-paths --output /tmp/final_test.md --no-clipboard app _cgo_.o ux-amd64/pkg/tool/linux_amd64/cgo /tmp/go-build181git -O2 -fno-stack-prote-v ux-amd64/pkg/tooorigin -W -I [email protected]/bash pkg/mod/golang.org/[email protected] . --gdwarf2 t pkg/mod/golang.org/[email protected]/tmp/go-build1816759422/b177/ (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>The directory structure contains absolute path information using --relative-paths.</issue_title>
<issue_description>Version v0.15.1

When the script is executed as:

ingest --relative-paths --output .cursor/ingest.md app

The information relating to Source Trees also contains absolute paths:

Source Trees:

/home/lito/www/tracker/httpdocs/app:
app/
├── Console/

The use of --relative-paths should mean that under no circumstances should any relative paths be added to the generated markdown.

Thanks a lot for this great tool.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix absolute path information in markdown output Fix --relative-paths flag for Source Trees section header Jan 17, 2026
Copilot AI requested a review from sammcj January 17, 2026 20:45
@sammcj sammcj requested a review from Copilot January 18, 2026 19:21
@sammcj sammcj marked this pull request as ready for review January 18, 2026 19:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where the --relative-paths flag was not applied to Source Trees section headers, causing absolute paths to appear in the headers even when relative paths were requested throughout the rest of the output.

Changes:

  • Modified tree header path handling to use basename when --relative-paths is enabled for directory processing
  • Modified file header path handling to use basename when --relative-paths is enabled for single file processing

@sammcj sammcj merged commit 365d8b1 into main Jan 18, 2026
12 checks passed
@sammcj sammcj deleted the copilot/fix-absolute-paths-issue branch January 18, 2026 19:25
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.

The directory structure contains absolute path information using --relative-paths.

3 participants