Issue with .gitkeep Files and Branch Switching
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:
- Create a repository with empty directories containing .gitkeep files.
- Switch between branches and observe the behavior of these directories.
- 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
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 ☺️
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 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
@akshay-gupta7 @keeganedwin this issue should be reopened as mentioned above. We have the same issue at IBM iX, everytime you do a change in Token Studio, 3 commits are made and the Git history is completely messed up
@akshay-gupta7 @keeganedwin this issue should be reopened as mentioned above. We have the same issue at IBM iX, everytime you do a change in Token Studio, 3 commits are made and the Git history is completely messed up
@efoken, yes we fixed this issue in a PR open for this and the fix will come in the next release
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.
@Sidnioulz @efoken , the fix for this is now released in the latest version of our plugin Just FYI, if there is an existing gitkeep file in your repository, there shall be only one extra commit to delete it, but that happens only once, in your subsequent commits, you should not be seeing any repetition.
Thanks @akshay-gupta7! I look forward to using it!