Skip to content

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

Merged
dscho merged 1 commit into
git-for-windows:masterfrom
dscho:nicer-upgrade-path-for-#2637
Jun 6, 2020
Merged

mingw: special-case index entries for symlinks with buggy size#2666
dscho merged 1 commit into
git-for-windows:masterfrom
dscho:nicer-upgrade-path-for-#2637

Conversation

@dscho
Copy link
Copy Markdown
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 <johannes.schindelin@gmx.de>
@billziss-gh
Copy link
Copy Markdown

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
Copy Markdown
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
dscho added a commit that referenced this pull request Jun 22, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 23, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Jun 23, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Jun 23, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 25, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 25, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 26, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 27, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 29, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jun 30, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Jun 30, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jul 2, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jul 2, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Jul 2, 2020
mingw: special-case index entries for symlinks with buggy size
dscho added a commit that referenced this pull request Jul 2, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jul 3, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jul 3, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jul 3, 2020
mingw: special-case index entries for symlinks with buggy size
git-for-windows-ci pushed a commit that referenced this pull request Jul 3, 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