Skip to content

mingw: special-case index entries for symlinks with buggy size #2666

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

Merged
merged 1 commit into from
Jun 6, 2020

Conversation

dscho
Copy link
Member

@dscho dscho commented Jun 4, 2020

Let's not mark symbolic links as modified always when upgrading to v2.27.0: we can detect that situation and simply
pretend that a symbolic link with a known bad size was just checked it out, and therefore needs to be re-checked.

This will help people who upgrade from pre-v2.27.0 versions to post-v2.27.0 versions (but unfortunately not when upgrading to v2.27.0).

Cc: @billziss-gh

In git-for-windows#2637, we fixed a bug
where symbolic links' target path sizes were recorded incorrectly in the
index. The downside of this fix was that every user with tracked
symbolic links in their checkouts would see them as modified in `git
status`, but not in `git diff`, and only a `git add <path>` (or `git add
-u`) would "fix" this.

Let's do better than that: we can detect that situation and simply
pretend that a symbolic link with a known bad size (or a size that just
happens to be that bad size, a _very_ unlikely scenario because it would
overflow our buffers due to the trailing NUL byte) means that it needs
to be re-checked as if we had just checked it out.

Signed-off-by: Johannes Schindelin <[email protected]>
@billziss-gh
Copy link

This looks reasonable to me.

My apologies for not looking at this issue earlier, but I have had to work on a problem in my own software.

@dscho
Copy link
Member Author

dscho commented Jun 6, 2020

This looks reasonable to me.

Thank you!

My apologies for not looking at this issue earlier, but I have had to work on a problem in my own software.

No worries at all!

@dscho dscho merged commit ba03143 into git-for-windows:master Jun 6, 2020
@dscho dscho deleted the nicer-upgrade-path-for-#2637 branch June 6, 2020 23:53
git-for-windows-ci pushed a commit that referenced this pull request Jun 6, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 6, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 6, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 8, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 8, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 8, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 8, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 9, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 9, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 9, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 9, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 9, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Jun 10, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 11, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Jun 11, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 12, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 12, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 16, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 16, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 16, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 16, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 18, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 25, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 25, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 27, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 27, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 28, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 28, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 28, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Sep 29, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Sep 29, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Sep 29, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Sep 29, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 29, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Sep 29, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Sep 30, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 1, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 2, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 2, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Oct 2, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Oct 2, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Oct 2, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 2, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 2, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 4, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 5, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 5, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Oct 5, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Oct 5, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Oct 6, 2020
mingw: special-case index entries for symlinks with buggy size
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