Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Clear error when rebase has broken parent reference #415

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OskiKervinen-MF
Copy link
Contributor

I had rebased the commit where I performed the git subrepo clone and when I tried to do a pullafter that, I received the error

git-subrepo: Command failed: 'git branch subrepo/utilities/cacherer '.
fatal: Not a valid object name: ''.

I was able to figure out this was because of the rebase eventually, but it took some doing, so I made this MR to make the problem obvious in the future.

Also replaced one raw reference to .git with an invocation of git rev-parse --git-dir.

@admorgan
Copy link
Collaborator

admorgan commented Jul 19, 2019

I like the error message change, but #407 does a better job fixing the submodule issue.

…HEAD

Before, there would be a cryptic error about invalid parameters,
because prev_commit would never get set.

This situation can occur when the commit that last touched the subrepo
has been rebased.
Moved the parent verification inside the branch that actually
depends on the parent. Without that it fails needlessly when
there is no parent yet.
@OskiKervinen-MF OskiKervinen-MF force-pushed the topic/clear-error-on-dishinheritance branch from c8788f2 to f261515 Compare July 22, 2019 06:41
@OskiKervinen-MF
Copy link
Contributor Author

I removed the part that touched the submodule issue. The remaining test failures seem to equal those in master.

@arichardson
Copy link

I've accidentally rebased after doing a subrepo push/pull a few times and then getting weird failures the next time I try to update. Having a meaningful error message would be really useful.
Thanks!

@taktran
Copy link

taktran commented Apr 17, 2024

I found a potential fix for this issue here: #617

admorgan added a commit to admorgan/git-subrepo that referenced this pull request Jul 11, 2024
I did not find it immediately obvious how to gather the
information needed to fix a missing parent error. Search the
repository for the values needed and present them as part of the
message.

Fixes ingydotnet#617, ingydotnet#415, ingydotnet#600
admorgan added a commit that referenced this pull request Jul 22, 2024
I did not find it immediately obvious how to gather the
information needed to fix a missing parent error. Search the
repository for the values needed and present them as part of the
message.

Fixes #617, #415, #600
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants