All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vang Nguyen <mtb.vang@gmail.com>
To: git@vger.kernel.org
Subject: git subtree push could not rev-parse split hash...bug?
Date: Tue, 19 Jan 2021 11:27:50 +0100	[thread overview]
Message-ID: <CAL+53obGBFwA2bscvNF=fHkF5eLLEpL6rSZYygkob9-u1fXkHQ@mail.gmail.com> (raw)

Hi,

We have a parentRepo with a subtreeRepo. When multiple people git
subtree push from the parentRepo to the subtreeRepo origin if you
weren't the last to do the push you get the following error:

git subtree push --prefix=subtreeRepo
git@github.com:projectname/subtreeRepo.git master
git push using:  git@github.com:projectname/subtreeRepo.git master
fatal: ambiguous argument
'f7e47b631c71ccf50c46f8e762dc043bcde4e7c1^0': unknown revision or path
not in the working tree.
Use '--' to separate paths from revisions, like this:
'git command [revision...] -- [file...]'
could not rev-parse split hash
f7e47b631c71ccf50c46f8e762dc043bcde4e7c1 from commit
1ce2d3f972571df5e52e97391e0f799b6140ee5b
To github.com:projectname/subtreeRepo.git
 ! [rejected]        7411fe6059e0f7af62df52e38e647b77bcfec151 ->
master (fetch first)
error: failed to push some refs to 'git@github.com:projectname/subtreeRepo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Makefile:675: recipe for target 'git-subtree-push-subtreeRepo' failed

The command run to do the push is:

git subtree push --prefix=subtreeRepo
git@github.com:projectName/subtreeRepo.git master

git version 2.17.1

A workaround seems to be to do a
git subtree pull --prefix=subtreeRepo
git@github.com:projectname/subtreeRepo.git master --squash
and then abort the results of the subtree pull with git reset --hard
origin/master.
The the git subtree push works fine.

The message doesn't seem to make sense since the split hash f7e47b631
and commit 1ce2d3f9 are there and it all seems like it should work.

I see that there's a ^0 at the end of the split hash in the error
message. Is that supposed to be there? fatal: ambiguous argument
'f7e47b631c71ccf50c46f8e762dc043bcde4e7c1^0'.

Regards,

Vang

                 reply	other threads:[~2021-01-19 18:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL+53obGBFwA2bscvNF=fHkF5eLLEpL6rSZYygkob9-u1fXkHQ@mail.gmail.com' \
    --to=mtb.vang@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.