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

Is this supposed to dereference symlinks on a local/client repo while performing a git pull from a remote repo? #20

Open
ajkessel opened this issue Nov 28, 2023 · 2 comments

Comments

@ajkessel
Copy link

In my remote origin repo, a file under git control is just a normal file.

In my local repo, that same file is a symlink.

If I change the file on the origin repo and then execute git pull locally with BSLR enabled, is it supposed to compare the remote file to the target of the local symlink?

When I attempt git pull with the above steps, I get "error: Your local changes to the following files would be overwritten by merge:" and can't find any way to get around it -- stash on local says "no local changes to save" and commit says "nothing to commit."

@ajkessel ajkessel changed the title Is this supposed to dereference symlinks on a client performing a git pull? Is this supposed to dereference symlinks on a local/client repo performing a git pull from a remote repo? Nov 28, 2023
@ajkessel ajkessel changed the title Is this supposed to dereference symlinks on a local/client repo performing a git pull from a remote repo? Is this supposed to dereference symlinks on a local/client repo while performing a git pull from a remote repo? Nov 28, 2023
@Alcaro
Copy link
Owner

Alcaro commented Nov 28, 2023

If I change the file on the origin repo and then execute git pull locally with BSLR enabled, is it supposed to compare the remote file to the target of the local symlink?

Yes, that's what it's supposed to do.

What it actually does is, of course, a different question.

I've never tried git stash, and like all untested features, fair chance it's buggy. You've double checked that you're passing the same env vars to GitBSLR for all invocations, right?

You could set GITBSLR_DEBUG=1 and it'll tell what it's doing; if some specific file says 'leaving as link' under git pull, but 'following' for git stash (or other way round), that's definitely a bug.

Also check if the permission bits are the same; if a file changes from 644 to 755, Git considers that a change.

@ajkessel
Copy link
Author

ajkessel commented Nov 29, 2023

When I attempt to git pull with GitBSLR enabled, everything shows as "untouched because in .git" except this one file, where I always get this error if the file was changed in origin:

error: Your local changes to the following files would be overwritten by merge:
        (filename)
Please commit your changes or stash them before you merge.
Aborting

The environmental vars are set by the alias that invokes git, so they are always the same.

I can't get around that error by stashing or resetting -- I have to delete the local copy, re-pull, and then replace the local copy with the symlink to get it to work again.

One thing I just noticed running git stash with GitBSLR enabled is it reports this local file as "not a link" whereas it is definitely a symlink.

Note that the file is not a symlink in origin; only the local copy is supposed to be a symlink.

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

No branches or pull requests

2 participants