-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Encountered 433 files that should have been pointers, but weren't; --fixup does nothing #5162
Comments
Hey, I'm sorry you're having trouble. If by chance your problem is that The documentation says:
To make that more clear, here's an example where
But if your issue is that you don't have a (Also note that in the example above, the commit ID changes in the "Rewriting commits" phase, whereas in your example, the commit IDs don't change, meaning no history was actually altered.) What you would need to do is determine when the problematic files were introduced into your history and then use something like |
And just to show the reverse situation, which you may be facing:
Note that the |
Thank you for the great explanation. I now understand why --fixup is doing exactly what it was designed to do, and how that will not help my situation. I still wish there was a better way to fix this. Maybe I'm asking too much, but if --fixup can rewrite history, why can't it do the work of injecting a commit in the right spot to fix |
I started investigating the "rebase" option, but git refuses to let me do a rebase too:
Git thinks that I've modified these files, but won't allow me to revert them, or stash them. Which really limits what I'm able to do. This seems like the bug here. Why are these files marked as modified? I did not modify them. There is something wrong with the repository, but not my checkout. The error occurred when I committed a modified .getattributes file WITHOUT re-adding those files. That's what LFS should flag. Not a later checkout of the files. |
That would be a feature request, yeah, and I think the reason it isn't a feature already is because When you run diff --git a/foo.bin b/foo.bin
index 257cc56..ad483a9 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1 +1,3 @@
-foo
+version https://git-lfs.github.com/spec/v1
+oid sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c You might try the Then you should be able to rework your history, dropping the recent commit of |
Before I try the uninstall procedure, I'll answer the question you asked. Here is the output from
That's it. It doesn't actually show the content. |
I also tried a new clone after uninstalling LFS, but I had similar results. |
Sorry to hear you're still having trouble. The What does |
I still see git filter.lfs configuration. Running
|
OK, if you still see the
I expect you'll find a |
Thanks for the direction. I feel disappointed that |
I can appreciate that. The bare |
OK, I was able to use "rebase" to inject changes to ".gitattributes" at the right spot in history, but --fixup still doesn't seem to be working for me. You can see from the log output that .gitattributes was added before the relevant file; but even after a --fixup,
|
And, sorry, what does your |
It's long, but it has a line that looks like this:
|
Hmm. Well, that does all look right; I'm not certain why the You could try with It would also be interesting to see the output of Lastly, would you be able to either create a small reproduction case that could be shared, or share your repo as it is? |
One other thing you could try is to checkout the commit before the one which adds the
|
I can generate those logs, but the logs are huge (one of them is 170Megs). They also contain too much information about our company code to post on a public issue like this. Is there some way I could communicate the logs without posting them to a public forum? |
Yes, I'm sure we could arrange that, but before we get that far, it might be useful to try the little experiment I mentioned above, and also, if you're running a command like |
Ok. Here's the first log for |
And here's the filtered log for |
Here's the output from the experiment you wanted me to run (it worked as expected).
|
Thanks for these, I will try to take a look soon! I confess At a high level, what I'm hoping we can do is create a simple reproduction case, because then it's easier to figure out what's going on. Sometimes, though, even to get to that point we need to add tracing to the client until it's clear. You might experiment yourself (only if you have time, obviously) with building the client from source and throwing in some trace calls; that's pretty much all I'm going to be doing, I suspect, until the cause is identified. |
OK, I think I've come up with a recipe. I don't know why this triggers it, but here's what I did:
|
Excellent, thank you!! I have been able to reproduce the problem using a slightly adapted version of the above steps. First, create the base repo:
Then clone it locally, make modifications, and try to migrate:
I suspect, but have no proof yet, that this problem might stem from how the binary file blob turns up in two branches in different relation to the I haven't yet had a chance to take a look at your log file excepts, but this is fantastic as we can now play with the reproduction case repeatedly. Thank you very much for your patience and help on this issue!
|
OK, I've been able to narrow this down to a simpler replication case which focusses on having two branches where a potential Git LFS object is introduced in opposite order to the matching file pattern in The exact behaviour of
And as a reverse of the same problem, if we take the exact same thing but rename our branch
So, that's a definite bug, and if it wasn't obvious enough already from your reports, it seems like a fairly serious one. I'm going to stick our "bug" label on this issue and we'll try to address this as soon as time permits. Thanks again for all your patience and help; it's greatly appreciated. Open source runs on this kind of feedback from users! ❤️ |
Describe the bug
I have a repository with some lfs issues that I'm trying to understand how to fix. When I check out a specific branch, I get "stuck" in the branch. I can't switch out of the branch and I can't seem to fix the repository either.
I'm sure I could renormalize the files and commit the change, but I'm trying to "fix" the history to be as if I never made the mistake.
When I checkout this branch, I get this message:
I think someone (almost certainly me) modified
.gitattributes
and then committed some LFS files but did NOT add the.gitattributes
file to the commit itself (or maybe the exact opposite). Now I'm trying to repair the damage.I read #1939, and tried all the guidance in there, but nothing seemed to work.
I tried
git lfs migrate import --fixup --everything
, which said it was rewriting 32 commits:But "git status" still shows the same number of locally modified files, and
git push
does nothing:Expected behavior
I expected --fixup to change my local repository such that these files were correctly LFS pointers.
System environment
I'm running inside CentOS 7.
Output of
git lfs env
Additional context
Any other relevant context about the problem here.
#1939
The text was updated successfully, but these errors were encountered: