[BUG] Submodule Pull

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx':

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@xxxxxxxxxxxxx':

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@xxxxxxxxxxxxx':

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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux