|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Missing unknown when doing pull [message #1623960 is a reply to message #1587424] |
Thu, 19 February 2015 12:57 |
Christian Halstrick Messages: 274 Registered: July 2009 |
Senior Member |
|
|
I tried to reproduce. I tried to be quite close to the description you gave. But for me it works. The pull succeeds. Here is my script (containing also in which eclipse views I triggered what). What am I missing?
/tmp> uname -a
Linux vblub14 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
/tmp> git --version
git version 2.2.2
/tmp> git init --bare lib.git
Reinitialized existing Git repository in /tmp/lib.git/
/tmp> git clone lib.git lib2
Cloning into 'lib2'...
warning: You appear to have cloned an empty repository.
done.
/tmp> cd lib2/
/tmp/lib2> echo a >lib.jar
/tmp/lib2> git add lib.jar
/tmp/lib2> git commit -m "add lib.jar"
[master (root-commit) 22e3b1a] add lib.jar
1 file changed, 1 insertion(+)
create mode 100644 lib.jar
/tmp/lib2> git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 217 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
* [new branch] master -> master
/tmp/lib2> git tag VERSION_01
/tmp/lib2> git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
* [new tag] VERSION_01 -> VERSION_01
/tmp/lib2> cd ..
/tmp> git init --bare a.git
Initialized empty Git repository in /tmp/a.git/
/tmp> # In Eclipse "Git Repositories" view cloned file://tmp/a.git to ~/git/a2. Selected "clone submodules" during clone.
/tmp> # ... got warnings that I cloned an empty repository
/tmp>
/tmp> # Create a new Java project name "aproj" located at ~/git/a2
/tmp> # Project was automatically set to be version controlled by git repo ~/git/a2
/tmp> # The files .gitignore, .gitignore, .project got created
/tmp> # In Eclipse: staged the three files, commitet them and pushed upstream
/tmp>
/tmp> # In Eclipse "Git Repositories" view right-clicked on the repo, selected "add Submodule", Submodule Path="lib", URI=file:////tmp/lib.git
/tmp> # In Eclipse: committed the submodule addition, pushed upstream
/tmp>
/tmp> cd lib2/
/tmp/lib2> echo b >lib2.jar
/tmp/lib2> git add lib2.jar
/tmp/lib2> git commit -m "add lib2.jar"
[master ddfb416] add lib2.jar
1 file changed, 1 insertion(+)
create mode 100644 lib2.jar
/tmp/lib2> git push origin master
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 274 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
22e3b1a..ddfb416 master -> master
/tmp/lib2> git tag VERSION_02
/tmp/lib2> git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To /tmp/lib.git
* [new tag] VERSION_02 -> VERSION_02
/tmp/lib2> cd ..
/tmp> git clone a.git/ a3
Cloning into 'a3'...
done.
/tmp> cd a3
/tmp/a3> git pull origin master
From /tmp/a
* branch master -> FETCH_HEAD
Already up-to-date.
/tmp/a3> git submodule init
Submodule 'lib' (file:////tmp/lib.git) registered for path 'lib'
/tmp/a3> git submodule update
Cloning into 'lib'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
Checking connectivity... done.
Submodule path 'lib': checked out '22e3b1af9de89bc8e31285426ecb27983f2def8c'
/tmp/a3> cd lib
/tmp/a3/lib> git fetch --tags origin master
From file:////tmp/lib
* branch master -> FETCH_HEAD
/tmp/a3/lib> git checkout VERSION_02
Previous HEAD position was 22e3b1a... add lib.jar
HEAD is now at ddfb416... add lib2.jar
/tmp/a3/lib> cd ..
/tmp/a3> git add .
/tmp/a3> git commit -m "updated a to version 02"
[master 2d0cb45] updated a to version 02
1 file changed, 1 insertion(+), 1 deletion(-)
/tmp/a3> git push origin master
Counting objects: 2, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 259 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
To /tmp/a.git/
a713eaa..2d0cb45 master -> master
/tmp>
/tmp> # In Eclipse "Package Explorer" view on project "aproj": Select "Pull"
/tmp> # Result: a succesfull "fast forward merge". See attached screenshot
/tmp>
/tmp/a3> cd ~/git/a2/
~/git/a2> git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: lib (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
~/git/a2> git log --oneline --decorate
2d0cb45 (HEAD, origin/master, master) updated a to version 02
a713eaa add submodule
9baf943 add project
~/git/a2>
-
Attachment: lub14.png
(Size: 196.68KB, Downloaded 652 times)
Ciao
Chris
|
|
|
|
|
|
|
|
|
|
Re: Missing unknown when doing pull [message #1645343 is a reply to message #1636549] |
Mon, 02 March 2015 13:10 |
Christian Halstrick Messages: 274 Registered: July 2009 |
Senior Member |
|
|
I retried on windows: It works for me. What am I doing wrong? Here is the exact script I used:
[/tmp]$ uname -a
MINGW32_NT-6.2 WDFN00318987A 1.0.12(0.46/3/2) 2012-07-05 14:56 i686 unknown
[/tmp]$ git --version
git version 1.9.5.msysgit.0
[/tmp]$ git init --bare lib.git
Initialized empty Git repository in C:/Users/d032780/AppData/Local/Temp/lib.git/
[/tmp]$ git clone lib.git lib2
Cloning into 'lib2'...
warning: You appear to have cloned an empty repository.
done.
[/tmp]$ cd lib2
[/tmp/lib2 (master)]$ echo a >lib.jar
[/tmp/lib2 (master)]$ git add lib.jar
[/tmp/lib2 (master)]$ git commit -m "add lib.jar"
[master (root-commit) a23822a] add lib.jar
1 file changed, 1 insertion(+)
create mode 100644 lib.jar
[/tmp/lib2 (master)]$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 217 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
* [new branch] master -> master
[/tmp/lib2 (master)]$ git tag VERSION_01
[/tmp/lib2 (master)]$ git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
* [new tag] VERSION_01 -> VERSION_01
[/tmp/lib2 (master)]$ cd ..
[/tmp]$ git init --bare a.git
Initialized empty Git repository in C:/Users/d032780/AppData/Local/Temp/a.git/
[/tmp]$ pwd
/tmp
[/tmp]$ # In Eclipse "Git Repositories" view cloned file://tmp/a.git to ~/git/a2. Selected "clone submodules" during clone.
[/tmp]$ # ... got warnings that I cloned an empty repository
[/tmp]$
[/tmp]$ # Create a new Java project name "aproj" located at ~/git/a2
[/tmp]$ # Project was automatically set to be version controlled by git repo ~/git/a2
[/tmp]$ # The files .gitignore, .gitignore, .project got created
[/tmp]$ # In Eclipse: staged the three files, commitet them and pushed upstream
[/tmp]$
[/tmp]$ # In Eclipse "Git Repositories" view right-clicked on the repo, selected "add Submodule", Submodule Path="lib", URI=file:////tmp/lib.git
[/tmp]$ # In Eclipse: committed the submodule addition, pushed upstream
[/tmp]$
[/tmp]$ cd lib2
[/tmp/lib2 (master)]$ echo b>lib2.jar
[/tmp/lib2 (master)]$ git add lib2.jar
[/tmp/lib2 (master)]$ git commit -m "add lib2.jar"
[master 650d15f] add lib2.jar
1 file changed, 1 insertion(+)
create mode 100644 lib2.jar
[/tmp/lib2 (master)]$ git push origin master
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 273 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
a23822a..650d15f master -> master
[/tmp/lib2 (master)]$ git tag VERSION_02
[/tmp/lib2 (master)]$ git push origin --tags
Total 0 (delta 0), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/lib.git
* [new tag] VERSION_02 -> VERSION_02
[/tmp/lib2 (master)]$ cd ..
[/tmp]$ git clone a.git/ a3
Cloning into 'a3'...
done.
[/tmp]$ cd a3
[/tmp/a3 (master)]$ cd pull origin master
sh.exe": cd: pull: No such file or directory
[/tmp/a3 (master)]$ git pull origin master
From C:/Users/d032780/AppData/Local/Temp/a
* branch master -> FETCH_HEAD
Already up-to-date.
[/tmp/a3 (master)]$ git submodule init
Submodule 'lib' (file:///C:\Users\d032780\AppData\Local\Temp\lib.git) registered for path 'lib'
[/tmp/a3 (master)]$ git submodule update
Cloning into 'lib'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
Checking connectivity... done.
Submodule path 'lib': checked out 'a23822a24a64426a03fe512510e98eeb5a6720ab'
[/tmp/a3 (master)]$ cd lib
[/tmp/a3/lib ((VERSION_01))]$ git fetch --tags origin master
From file:///C:\Users\d032780\AppData\Local\Temp\lib
* branch master -> FETCH_HEAD
[/tmp/a3/lib ((VERSION_01))]$ git checkout VERSION_02
Previous HEAD position was a23822a... add lib.jar
HEAD is now at 650d15f... add lib2.jar
[/tmp/a3/lib ((VERSION_02))]$ cd ..
[/tmp/a3 (master)]$ git add .
[/tmp/a3 (master)]$ git commit -m "updated a to version 02"
[master 0a33b1e] updated a to version 02
1 file changed, 1 insertion(+), 1 deletion(-)
[/tmp/a3 (master)]$ git push origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 257 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
To C:/Users/d032780/AppData/Local/Temp/a.git/
2c4f843..0a33b1e master -> master
[/tmp/a3 (master)]$ cd ~/git/a2
[~/git/a2 (master)]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: lib (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
[~/git/a2 (master)]$ git log --oneline --decorate
0a33b1e (HEAD, origin/master, master) updated a to version 02
2c4f843 add submodule
4aeedc2 create prj
Ciao
Chris
|
|
|
Re: Missing unknown when doing pull [message #1646056 is a reply to message #1645343] |
Mon, 02 March 2015 20:52 |
Mattias Andersson Messages: 23 Registered: April 2013 |
Junior Member |
|
|
Hi Christian ,
I tried with the exact same commands as you have and I still got the exception. So I just went through all git settings and found merge.ff=false in my git user settings.
Changing this to merge.ff=true and the error was gone .
So setting merge.ff=false in Git User Setting triggers the missing unknown exception when pulling commits containing sub modules changes as far as I can tell.
After the exception do a Team ->Reset (--hard) and change the Git User Stetting to merge-ff=true and Team->pull will succeed.
I tried using "--no-ff" with native git (which I believe is the same) and it worked.
I used:
$ git config branch.master.mergeoptions "--no-ff"
and then when I did the pull in the a2 repository I got the following output.
man@SUPERMAN /f/git/a2 (master)
$ git pull origin master
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
From file:///F:\git\a
* branch master -> FETCH_HEAD
8d209df..a0e006a master -> origin/master
Fetching submodule lib
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From file:///F:\git\lib
db71fdc..007d5b3 master -> origin/master
* [new tag] VERSION_06 -> VERSION_06
* [new tag] VERSION_04 -> VERSION_04
Merge made by the 'recursive' strategy.
lib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
The "--no-ff" option did change the output from git pull compare to when -"--no-ff" was not set. But the end result is the same for both cases...
I tell the developers here to set merge.ff to true and hopefully this will fix these issues for us.
But I guess JGit should be enhanced (in the future) to support -merge.ff =false together with sub modules as well since as far as I can tell it works with native git.
Br,
/Mattias
[Updated on: Mon, 02 March 2015 20:52] Report message to a moderator
|
|
|
|
|
|
|
Re: Missing unknown when doing pull [message #1723423 is a reply to message #1723366] |
Mon, 15 February 2016 14:43 |
Piotr Tomiak Messages: 7 Registered: May 2011 |
Junior Member |
|
|
> Do you also have the configuration merge.ff=false ?
No. What I suspect is, this parameter was forcing to create a commit and without it, a normal fast-forward operation happened, which didn't get to problematic "merge" code.
> What is the output if you execute 'git config --get-regexp '.*merge.*'' in the root folder of your repo.
Nothing. I've checked my global config and there are just email/user settings.
Note that missing unknown ae355286bf70bf78444500f4e8d2df47af3dfb68 is hash of the commit object of submodule - you can see in the script that this commit is being checked out in submodule and that state is committed to master. The JGit code seems to treat submodule commit object as file object in the merge logic.
[Updated on: Mon, 15 February 2016 15:00] Report message to a moderator
|
|
|
|
|
|
|