Skip to content

Recreate README.md as a non-symlink #250

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saschanaz
Copy link

@saschanaz saschanaz commented Apr 29, 2025

Q: You just deleted and recreated it? In a single commit?! What the heck?

Ah yeah, I was just pinged by my one of my colleagues who had a problem when checking out this repository and found there's a weirdness. That the main README.md and the scraper/README.md are both symlinks! Except the latter is not really supposed to be a symlink but a file. Still you can see it still being a symlink from GitHub:

image

My PR fixes it:

image

But what about the git blame?

Only my commit will appear for every line, but not sure there's a better way. There should be, I'm just not aware of it.

So what did you actually do?

I deleted the file, committed it, recreated one, committed it again, and squashed those two commits. Git shows "typechange" when you run git commit --amend on top of my commit:

Recreate README.md (typechange in git)

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      Tue Apr 29 14:28:18 2025 +0200
#
# On branch readme-symlink2
# Your branch is up to date with 'origin/readme-symlink2'.
#
# Changes to be committed:
#	typechange: scraper/README.md
#

But git still thinks I created every line when you run git blame. Huh.

@fiji-flo
Copy link

This solves the issue that on macOS you get:

git clone [email protected]:rust-scraper/scraper.git
Cloning into 'scraper'...
remote: Enumerating objects: 1748, done.
remote: Counting objects: 100% (531/531), done.
remote: Compressing objects: 100% (186/186), done.
remote: Total 1748 (delta 442), reused 352 (delta 344), pack-reused 1217 (from 3)
Receiving objects: 100% (1748/1748), 405.25 KiB | 1.01 MiB/s, done.
Resolving deltas: 100% (982/982), done.
error: unable to create symlink scraper/README.md: File name too long
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants