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

Sometimes, .gitignore is not respected and files listed in .gitignore are included in the commits created by multi-gitter #356

Open
andyren0110 opened this issue Jun 29, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@andyren0110
Copy link

Describe the bug
I don't know how to produce a minimum repro. But I used multi-gitter to make some changes in about 30 repos, and ran yarn install, and then commit the changes. In some of the PRs it created, node_modules folder is included. node_modules are added to all the repos .gitignore. I checked out those branches, did a git reset HEAD~ and then commit all the changes again, node_modules files are no long included in the commit. I'm wondering how multi-gitter commits changes? Does it sometimes use a -f flag when committing the changes with git commit?

Expected behavior
Changes resulted from running a script but are explicitly listed in .gitignore should not be included in the PR created by multi-gitter.

Additional context
Add any other context about the problem here.
It is for example often useful to include detailed logs from a run with --log-level=trace.

@andyren0110 andyren0110 added the bug Something isn't working label Jun 29, 2023
@lindell
Copy link
Owner

lindell commented Jun 29, 2023

Thanks for the bug report, but without any repro, it will be hard to solve, or even verify if it actually is a problem. Maybe it does repro with some specific git ignore files that you can share?

I still have two questions.

  1. Does this also happen when running with --git-type=cmd
  2. Does it always happen on the same repos?

@andyren0110
Copy link
Author

Totally understand that it's hard to solve without a repro. Let me try to work on a minimal repro.
I read somewhere that having multiple .gitignore could cause issues and indeed all these repos have multiple .gitignore files.
Regarding your questions:

  1. Let me try that.
  2. It doesn't. It's a different set of repos that get node_modules included in the PR in different runs.

@lindell
Copy link
Owner

lindell commented Jul 3, 2023

Any progress on a minimal set of .gitignore that sometimes repro this, and/or running it with --git-type=cmd?

@andyren0110
Copy link
Author

andyren0110 commented Jul 5, 2023

Yes. --git-type=cmd fixed the issue.

I don't have a minimal repro yet. Still working on it.

@lindell
Copy link
Owner

lindell commented Aug 23, 2023

@andyren0110 Any update on this?

2 similar comments
@lindell
Copy link
Owner

lindell commented Oct 12, 2023

@andyren0110 Any update on this?

@lindell
Copy link
Owner

lindell commented Nov 1, 2023

@andyren0110 Any update on this?

@nwsparks
Copy link

git-xargs had/has the same problem gruntwork-io/git-xargs#53

this leads me to believe it is a problem with go-git. a quick search in the issues there reveals quite a few problems around gitignore unfortunately. seems like changing --git-type or appending git clean -fxd / -fXd to the end of scripts are the best options if it is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants