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

Issue with .gitkeep Files and Branch Switching #3160

Closed
keeganedwin opened this issue Sep 30, 2024 · 3 comments · Fixed by #3199
Closed

Issue with .gitkeep Files and Branch Switching #3160

keeganedwin opened this issue Sep 30, 2024 · 3 comments · Fixed by #3199
Assignees

Comments

@keeganedwin
Copy link
Collaborator

Describe the bug
User has a problem where when the try to push on gitlab the screenshot provided below shows up and they cannot see what is the problem but can just close it.

When switching branches, the presence of .gitkeep files, which are used to preserve empty directories in Git, seems to be related to a post 2.0 bug fix for GitLab. This mechanism may not be necessary and could be removed after thorough testing to ensure the bug is not reintroduced.

To Reproduce
Steps to reproduce the behavior:

  1. Create a repository with empty directories containing .gitkeep files.
  2. Switch between branches and observe the behavior of these directories.
  3. Note any inconsistencies or issues that arise.

Expected behavior
Empty directories should be preserved without the need for .gitkeep files, especially if other files are added later.

Screenshots or Screencasts
Screenshot 2024-09-18 at 14 35 00

@teyepe
Copy link

teyepe commented Oct 8, 2024

I can confirm that I’m running the same issue when pushing a branch to GitLab via plugin’s UI. No matter what the changes are, .gitkeep is consistently added to my commits.

In my case the problem occurs when I run some pipeline jobs, where it breaks the build. As of now, the only workaround is to manually delete the .gitkeep each time before merging my branch and finally run the pipeline.

Ideally, I’d like to get rid of that file entirely. Thanks ☺️

@Sidnioulz
Copy link

Hi folks. I don't think the fix for this is correct.

Right now, on a well-established repo with tokens already synchronised, creating a branch and making a change results in the branch being pushed with three identical commit messages:

  • A commit creating the gitkeep file
  • The actual token changes
  • A commit removing the gitkeep file

This completely messes up our changelog generation. My understanding of this issue is that something was happening which shouldn't have. Instead of fixing that root cause, #3199 causes another thing to happen which has additional side effects.

@akshay-gupta7
Copy link
Contributor

Hi folks. I don't think the fix for this is correct.

Right now, on a well-established repo with tokens already synchronised, creating a branch and making a change results in the branch being pushed with three identical commit messages:

  • A commit creating the gitkeep file
  • The actual token changes
  • A commit removing the gitkeep file

This completely messes up our changelog generation. My understanding of this issue is that something was happening which shouldn't have. Instead of fixing that root cause, #3199 causes another thing to happen which has additional side effects.

Hi @Sidnioulz , thanks for bringing this to our notice, we are investigating this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants