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

Feat: Propose .repopackignore file to override .gitignore for repopack bundles #12

Closed
massdo opened this issue Jul 26, 2024 · 4 comments · Fixed by #13
Closed

Feat: Propose .repopackignore file to override .gitignore for repopack bundles #12

massdo opened this issue Jul 26, 2024 · 4 comments · Fixed by #13

Comments

@massdo
Copy link
Contributor

massdo commented Jul 26, 2024

Hello,

First, thank you for this very useful project!

I'd like to suggest a feature that could enhance repopack's flexibility.

Current situation:

I have a file "claude-custom-instructions.txt" that I want to include in my repopack bundle, but it's listed in my .gitignore file. Currently, to include this file, I need to set ignore.useDefaultPatterns = false and then manually add all the patterns I want to ignore in ignore.customPatterns. This works, but it's a bit cumbersome.

Feature proposal:

Introduce a new file called .repopackignore that would override .gitignore settings specifically for repopack bundles when present. Here's how it could work:

  1. If a .repopackignore file exists in the repository, repopack would use it instead of .gitignore.
  2. The syntax would be similar to .gitignore, allowing users to easily specify which files to include or exclude from the bundle.

Benefits:

  • Simpler management of bundle-specific ignores
  • Maintains separation between git ignore rules and repopack bundle rules
  • Allows users to easily include files in repopack bundles that are git-ignored

I'd appreciate your thoughts on this idea and whether it aligns with the project's goals.

Thank you again !

@massdo massdo changed the title Propose .repopackignore file to override .gitignore for repopack bundles Feat: Propose .repopackignore file to override .gitignore for repopack bundles Jul 26, 2024
@yamadashy
Copy link
Owner

Hello,

Thank you for your valuable feature proposal!
You're absolutely right; the current setup does cause the issue. Your idea is great and .repopackignore would not only allow including git-ignored files but also provide an easier way to specify ignore patterns compared to the current ignore.customPatterns configuration.

However, I've been considering a slightly different approach that might offer even more flexibility. Here's what I'm thinking:

  1. Introduce a new .repopackignore file for Repopack-specific ignore patterns, as you suggested.

  2. Add a new configuration option useGitignorePatterns (default: true) in repopack.config.json:

    {
      "ignore": {
        "useGitignorePatterns": true,
        // other existing options...
      }
    }

Key points:

  • If set to false and use .repopackignore, it would solve your issue by allowing Repopack to include git-ignored files.
  • If set to true (default), it would merge .gitignore and .repopackignore patterns. This addresses a potential future requirement I've envisioned.

This approach would maintain flexibility for both current needs and potential future requirements.

What do you think about this alternative? Does it still address your needs? I'm very open to your feedback and any further suggestions you might have.

Thank you again for helping improve Repopack!

@yamadashy
Copy link
Owner

yamadashy commented Jul 27, 2024

Hello,

I've made some modifications to your approach and implemented a solution. I've created a pull request:

I believe this approach provides flexibility for both current needs and potential future requirements.

@yamadashy
Copy link
Owner

yamadashy commented Jul 27, 2024

I'm merging this pull request now and I'm pleased to inform you that these changes have been released in version 0.1.13!

If you have any feedback on the new release or encounter any issues, please don't hesitate to let me know.

@yamadashy
Copy link
Owner

yamadashy commented Jul 29, 2024

I'll close this issue now.
Please feel free to provide more feedback if you have any in the future!

Thank you for your feedback!

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 a pull request may close this issue.

2 participants