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

t5050-update-orphans failures with Git 2.30.1 #18

Closed
thmo opened this issue Mar 2, 2021 · 8 comments
Closed

t5050-update-orphans failures with Git 2.30.1 #18

thmo opened this issue Mar 2, 2021 · 8 comments

Comments

@thmo
Copy link

thmo commented Mar 2, 2021

t5050-update-orphans.sh fails with Git 2.30.1, see the attached t5050-update-orphans.log.

@matttbe
Copy link

matttbe commented Mar 2, 2021

Hello,

I think I hit this bug this week with Git 2.30 as well. tg update fails with the same error:

tg: fatal: git checkout-index failed

I had to quickly fix it and then I was unable to reproduce it after. I was looking after a way to reproduce it and I'm glad you open this new bug report :-)

I don't know if the following would be useful to someone here but here is I wrote when I had the issue:

  • I had a merge conflict with tg update when it was in a top-base ref doing a merge
  • git checkout-index was unable to retrieve the .top* files but it looks like they were not needed (see below)
  • I abort the merge, reset everything and then I re-launched tg update after having changed die with an echo after git checkout-index call in tg-update script. Then it was OK.

BTW: thanks for maintaining and developing this really useful tool :-)

@thmo
Copy link
Author

thmo commented Mar 2, 2021

Made a git bisect session, and unless I did something wrong, git/git@7e410615 is the first commit that makes this test fail.

@thmo
Copy link
Author

thmo commented May 1, 2021

Any idea how to fix this?

@matttbe
Copy link

matttbe commented Jun 8, 2021

Hello,

* I abort the merge, reset everything and then I re-launched `tg update` after having changed `die` with an `echo` after `git checkout-index` call in `tg-update` script. Then it was OK.

Because other people contacted me to know exactly what I did, here is the patch I applied as a workaround for Git >=v2.30

diff --git a/tg-update.sh b/tg-update.sh
index 1776d52..cf22f3f 100644
--- a/tg-update.sh
+++ b/tg-update.sh
@@ -566,7 +566,7 @@ git_topmerge()
                                fi
                        done
                        (cd "$repotoplvl" && git checkout-index -q -f -u -- .topdeps .topmsg) ||
-                       die "git checkout-index failed"
+                       echo "WARN: git checkout-index failed"
                fi
                # dump output without any .topdeps or .topmsg messages
                sed -e '/ \.topdeps/d' -e '/ \.topmsg/d' <"$tmpstdout"

then re-launch make install.

Or if you have installed TopGit from a package, do the same modification in the file in /usr/libexec/topgit/tg-update (or replace /usr by the prefix you used, e.g. /usr/local)

With this, I have the warning but it doesn't seem to be an issue because .topdeps and .topmsg doesn't need to be reset.

@mackyle
Copy link
Owner

mackyle commented Jun 14, 2021

I've finally been able to get back to this project.

That patch is fine, but this one is simpler:

https://github.com/mackyle/topgit/blob/d26402c9f96df267/patch.txt

The help for git help checkout-index clearly states:

OPTIONS
       -q, --quiet
           be quiet if files exist or are not in the index

But since Git v2.30.0 it's no longer "quiet" -- I consider throwing an error code not being quiet -- even if the -q switch is given when files are not in the index. As far as I can tell, the operation is unaffected, it's just now throwing an error code. The patch is temporary, a real fix will be in the next TopGit release.

It will also include a proper fix for issue #17 which first appeared in Git v2.29.0 and a fix for the change in how <refname>@{0} gets interpreted starting in Git v2.31.0 (I don't have a patch to fix that one yet and it causes further t6100 breakage).

@matttbe
Copy link

matttbe commented Jun 14, 2021

Thank you for looking at that, providing a better workaround and explaining the issue!

@mackyle
Copy link
Owner

mackyle commented Sep 10, 2021

The topgit-0.19.13 release contains a resolution for this (and other reported issues).

@mackyle mackyle closed this as completed Sep 10, 2021
@thmo
Copy link
Author

thmo commented Sep 10, 2021

Thank you!

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

3 participants