-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Request for support to ignore files or directories in patch-commit command #6565
Comments
I don't understand this scenario. Why do you modify files if you don't want them to be in the patch? |
I apologize for any confusion caused. Allow me to clarify the scenario. In some cases, when working with patches, there may be certain files or directories that we do not want to include in the patch but are inadvertently included due to various factors. For example, when using an IDE like WebStorm to open the patched project, the IDE may generate certain files or directories (e.g., .idea) in the project's root directory. This can be frustrating because these files should not be part of the patch. Similarly, when sharing the patched project through Git within a company, it is important to track and share the history of modifications. However, when executing the patch-commit command, the entire .git folder, including its contents, is included in the patch, which is not desirable. The request to ignore specific files or directories in the patch-commit command aims to address these situations. By allowing users to specify which files or directories should be excluded from the patching process, we can have more control over the patch's content and ensure that only the intended changes are included. I hope this clarifies the reasons behind the request for the ability to ignore files or directories in the patch-commit command. Please let me know if you have any further questions or concerns. |
I see, makes sense. I think it would be best to ignore these files be default, if possible. We can ignore |
I appreciate your understanding. It is indeed beneficial to have certain files, like the In addition to the default ignore list, it would be valuable to provide a configurable option for users to specify additional files or directories to ignore during the patching process. This would allow users to customize the ignore list according to their specific project needs and requirements. By striking a balance between convenience and flexibility, we can provide a default ignore list that includes common files and directories, such as .git, while also empowering users to extend or modify the list as needed. To achieve this, incorporating a configuration file, such as an With the support of a configuration file, users would have fine-grained control over which files and directories are excluded from the patching process. They can easily manage and adjust the ignore patterns within the configuration file, ensuring that the resulting patch commits accurately reflect their desired changes. |
Maybe we can use the By adopting the Taking inspiration from the |
We could utilize the the settings that are already present for telling pnpm which files to include, when packing the package.
|
Describe the user story
As a developer, I often want to use the patch-commit command in pnpm to apply patches to my project, but I face difficulties in excluding specific files or directories from the patch commit process.
Describe the solution you'd like
I would like the patch-commit command in pnpm to support the ability to ignore certain files or directories during the patch commit process. This would allow me to have better control over the scope of my commits and avoid including unnecessary changes.
Describe the drawbacks of your solution
One potential drawback of implementing this feature is the increased complexity in managing and configuring the ignore functionality. It may require additional options or configuration files to specify the files or directories to be ignored. There could also be potential compatibility issues with existing workflows or tools that rely on the current behavior of the patch-commit command.
Describe alternatives you've considered
One alternative solution could be to manually modify the patch files generated by pnpm to remove the unwanted changes before committing. However, this approach is error-prone and time-consuming, especially when dealing with multiple patch files or complex patches. Another alternative could be to create separate branches or patches for different sets of files, but this would lead to a more fragmented version control history and make it harder to track and manage the patches effectively.
Overall, I believe that adding the ability to ignore files or directories in the patch-commit command would provide a more flexible and streamlined patching process within pnpm.
The text was updated successfully, but these errors were encountered: