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

🐛 Bug: File system can only store executable?: boolean, not mode?: number (Git is lossy) #133

Closed
3 tasks done
JoshuaKGoldberg opened this issue Jan 15, 2025 · 0 comments · Fixed by #134
Closed
3 tasks done
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :(
Milestone

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

The diffCreatedDirectory / intakeFromDirectory system added in #129 should be consistent across computers and OSs. If tests pass locally on, say macOS, they should pass in GHA on Linux.

Actual

I'm seeing in JoshuaKGoldberg/create-typescript-app#1839 that file permissions are different after the git clone on a different OS:

FAIL  src/integration.test.ts > Producing the everything preset matches the files in this repository
Error: Snapshot `Producing the everything preset matches the files in this repository 1` mismatched

- Expected
+ Received

@@ -17,6 +17,19 @@
   
   on:
  ",
      },
    },
+   ".husky": {
+     "pre-commit": [
+       undefined,
+       {
+         "mode": "@@ -1,1 +1,1 @@
+ -81ed
+ \ No newline at end of file
+ +[81](https://github.com/JoshuaKGoldberg/create-typescript-app/actions/runs/12791420171/job/35659497983?pr=1839#step:4:82)ff
+ \ No newline at end of file
+ ",
+       },
+     ],
+   },
  }

I did some digging and learned that version control by design can't save much more than "is this file executable?" thanks to https://www.reddit.com/r/git/comments/cc7tin/does_git_not_retain_file_permission_data. Which is really the only piece I actually cared about in templating: whether a file's permissions should be elevated to executable, such as for a .husky/pre-commit file. This is fine.

Additional Info

💝

@JoshuaKGoldberg JoshuaKGoldberg added type: bug Something isn't working :( status: accepting prs Please, send a pull request to resolve this! 🙏 labels Jan 15, 2025
@JoshuaKGoldberg JoshuaKGoldberg added this to the Blocks Launch milestone Jan 15, 2025
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :(
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant