git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <rsbecker@nexbridge.com>
To: <git@vger.kernel.org>
Subject: [BUG] Submodule Pull
Date: Tue, 21 Dec 2021 21:40:31 -0500	[thread overview]
Message-ID: <00f001d7f6dd$4d278580$e7769080$@nexbridge.com> (raw)

Hi All,

I have been working with a submodule, with a single local change. Trying to
(accidentally) pull the submodule to pick up changes from upstream resulted
in the change disappearing but blocking the pull/merge. The only way I was
able to recover the situation was to restore the file that was in the pull
error - fortunately, I know what the change was. I should know better, but
this situation escapes me. git version is 2.34.1 on NonStop x86.

What I expected was that the uncommitted change could be stashed
successfully or at least the diff would should up. My suspicion was that the
merge state prevented my ability to view what was going on. I probably
should have done a git merge --abort, which I expect would have cleared the
situation, but it is not intuitive. The log follows - and the user and repo
names are fake. The master branch is being changed to main, but we did not
finish the conversion on this submodule.

--Randall

$: git pull
Password for 'https://bobttester@bitbucket.org':

remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 4), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), 1.58 KiB | 12.00 KiB/s, done.
From https://bitbucket.org/main/submodule
   ca2d4d3..0bb118a  mybranch -> origin/mybranch
Updating ca2d4d3..0bb118a
error: Your local changes to the following files would be overwritten by
merge:
        Makefile.common
Please commit your changes or stash them before you merge.
Aborting
$ git diff
$ git status
On branch mybranch
Your branch is behind 'origin/mybranch ' by 1 commit, and can be
fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean
$ git diff --cached
$ git pull
Password for 'https://bobttester@bitbucket.org':

Updating ca2d4d3..0bb118a
error: Your local changes to the following files would be overwritten by
merge:
        Makefile.common
Please commit your changes or stash them before you merge.
Aborting
$ git stash push
No local changes to save
$ git log --oneline --decorate --graph --simplify-by-decoration
* 0bb118a (origin/mybranch) Support for measurement gathering
* ca2d4d3 (HEAD -> mybranch) Corrected usage of VMATCH
* 1739739 (origin/main, main) nsmt.c: Corrected CPU computation
| * ec45c8d (origin/master, origin/HEAD) Reduced the time to beginning of
time
| * bae1662 (master) Add beginning of time check
|/
* 6be05d2 README.md created online with Bitbucket
$ git merge origin/mybranch
Updating ca2d4d3..0bb118a
error: Your local changes to the following files would be overwritten by
merge:
        Makefile.common
Please commit your changes or stash them before you merge.
Aborting
$ git commit -a
On branch mybranch
Your branch is behind 'origin/mybranch' by 1 commit, and can be
fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean
$ git restore -- Makefile.common
$ git status
On branch mybranch
Your branch is behind 'origin/mybranch' by 1 commit, and can be
fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean
$ git pull
Password for 'https://bobttester@bitbucket.org':

Updating ca2d4d3..0bb118a
Fast-forward
 Makefile.common |  2 +-
 metra.c         |  6 +++++-
 metra.h         | 30 ++++++++++++++++++++++++------
 nsmt.c          | 32 +++++++++++++++++++++++++++-----
 4 files changed, 57 insertions(+), 13 deletions(-)


                 reply	other threads:[~2021-12-22  2:40 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='00f001d7f6dd$4d278580$e7769080$@nexbridge.com' \
    --to=rsbecker@nexbridge.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).