figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

Issue with .gitkeep Files and Branch Switching

Open keeganedwin opened this issue 1 year ago • 1 comments

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

keeganedwin avatar Sep 30 '24 16:09 keeganedwin

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 ☺️

teyepe avatar Oct 08 '24 14:10 teyepe

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 avatar Jan 31 '25 08:01 Sidnioulz

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 avatar Jan 31 '25 11:01 akshay-gupta7

@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 avatar Feb 19 '25 06:02 efoken

@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

akshay-gupta7 avatar Feb 19 '25 06:02 akshay-gupta7

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.

akshay-gupta7 avatar Feb 27 '25 14:02 akshay-gupta7

Thanks @akshay-gupta7! I look forward to using it!

Sidnioulz avatar Feb 27 '25 14:02 Sidnioulz