1364: git submodules don't work

anu****@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 17, 2014
What version are you running?

1.04

What's the URL of the page containing the problem?

r/new/

What steps will reproduce the problem?
1. create a diff using git in a repository w/ submodules. update a submodule, so that the pointer 
change is included in the diff.
2. upload the diff
3. breakage

What is the expected output? What do you see instead?
the diff should be accepted. instead it complains about files not being located in the repository 
(the submodule pointer).
david
#1 david
Is this failure in post-review or the diff viewer?
  • +NeedInfo
  • +git submodules don't work
david
#2 david
Oh, I guess you're making the diff by hand. Can you try post-review?
david
#3 david
  • -NeedInfo
    +Incomplete
#4 anu****@gmai***** (Google Code) (Is this you? Claim this profile.)
Just saw that this had some action last month; didn't see it in my mailbox, not sure
of google emailed me or not.

To answer your question, I'm not sure what you're asking. My work flow w/ reviewboard
is to just do:

git diff {options} > changesToReview.diff

and then upload it. The options I specify are usually what I'm diffing against; two
hashes, or another branch, etc.

When you make a diff when a submodule has been updated, the diff includes the change
to the submodule's hash. Uploading such a diff with that data breaks review board. It
complains that it doesn't know anything about that hash, which is an external value.
#5 Zilin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Hitting up with same problem. I used post-review, the problem is in the diff-viewer when it tries to apply the patch to the submodule, which isn't a file.
#6 fid***@gmai***** (Google Code) (Is this you? Claim this profile.)
I have the same problem.  post-review says:
Error uploading diff: One or more fields had errors (HTTP 200, API Error 105) Your review request still exists, but the diff is not attached. 

Uploading by hand says:
The file 'my/submodule' (re2ca3e8) could not be found in the repository


A git submodule is not a file in the repository, and should not be checked in that manner...  The diff says something like:

diff --git a/include/mulang b/include/mulang
index e2ca3e8..563a8ff 160000
--- a/my/submodule
+++ b/my/submodule
@@ -1 +1 @@
-Subproject commit e2ca3e8fa26423d688ecc2df79724ebc7a62d365
+Subproject commit 563a8ff762d19b6a2f11c22bfee2511408d4ac1d

(I'm using reviewboard 1.5.)
#7 fid***@gmai***** (Google Code) (Is this you? Claim this profile.)
Can this be reopened with the info added, or do we have to open a new issue?
I still bump into this problem each time a submodule version is updated in our git repo...
chipx86
#8 chipx86
  • -Incomplete
    +Confirmed
#9 pierre.********@intersec-********* (Google Code) (Is this you? Claim this profile.)
--submodule=log should be used, OR better, 

--- a/my/submodule
+++ b/my/submodule
@@ -1 +1 @@
-Subproject commit e2ca3e8fa26423d688ecc2df79724ebc7a62d365
+Subproject commit 563a8ff762d19b6a2f11c22bfee2511408d4ac1d

Should be parsed, removed from the original diff, 'git diff <sha1>..<sha2>' should be used and combined in the previous diff.


Using --submodule=log is just a simple hack that is likely to be a one liner (or a two liner) in how git diff/git show is called
#10 pierre.********@intersec-********* (Google Code) (Is this you? Claim this profile.)
Or alternativeley use --ignore-submodules…
david
#11 david
  • +Component-SCMTools
    +Component-RBTools
#12 nah****@gmai***** (Google Code) (Is this you? Claim this profile.)
Got bitten by that bug. Patching rbtools/postreview.py to add --ignore-submodules fixed it.
#13 ayust-te********@yelp**** (Google Code) (Is this you? Claim this profile.)
I submitted https://github.com/reviewboard/rbtools/pull/9 6 months ago, which fixes this problem... would be nice if someone accepted it.
david
#14 david
This has been fixed in rbtools for a while.
  • -Confirmed
    +Fixed