Submodule Diff (Sometimes) Empty?

38 views
Skip to first unread message

Doug Kelly

unread,
Jun 24, 2016, 12:05:34 PM6/24/16
to Repo and Gerrit Discussion
Hi everyone,

Not sure how to best report this currently, but we've seen a few rare cases where submodule diffs show empty in Gerrit 2.12.2.  Specifically, this seems to be when "Ignore Whitespace" is set to "none" and intraline diff is on.  If I change either of those options, the submodule diff shows as anticipated in the side-by-side view.  As a result, I thought this might've been a caching glitch, so I tried flushing the *entire* diff and diff_intraline caches only to have the exact same result.  At this point, I can't imagine what in particular could be leading to only certain changes to submodules behaving like this, but if anyone has any ideas -- including where I might start looking to gather useful information for a bug report, I'd be happy to provide what I can.

Thanks!

--Doug

Stefan Beller

unread,
Jun 27, 2016, 1:59:09 PM6/27/16
to Doug Kelly, hugo...@ericsson.com, Jacob Keller, dpurs...@collab.net, Repo and Gerrit Discussion
https://gerrit-review.googlesource.com/#/c/73221/
is the last change that touched both submodule as well as showing the
diff thereof.
IIUC, the version of JGit used is the crucial part and Gerrit just
tries to get along
with JGit weirdness.

So maybe there is a hint for the new weirdness? Maybe we did not pay
attention to
caching/glitches there?

Thanks,
Stefan

>
> Thanks!
>
> --Doug
>
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to repo-discuss...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Doug Kelly

unread,
Jun 27, 2016, 2:51:03 PM6/27/16
to Repo and Gerrit Discussion, doug...@gmail.com, hugo...@ericsson.com, jacob....@gmail.com, dpurs...@collab.net

On Monday, June 27, 2016 at 12:59:09 PM UTC-5, Stefan Beller wrote:
On Fri, Jun 24, 2016 at 9:05 AM, Doug Kelly <doug...@gmail.com> wrote:
> Hi everyone,
>
> Not sure how to best report this currently, but we've seen a few rare cases
> where submodule diffs show empty in Gerrit 2.12.2.  Specifically, this seems
> to be when "Ignore Whitespace" is set to "none" and intraline diff is on.
> If I change either of those options, the submodule diff shows as anticipated
> in the side-by-side view.  As a result, I thought this might've been a
> caching glitch, so I tried flushing the *entire* diff and diff_intraline
> caches only to have the exact same result.  At this point, I can't imagine
> what in particular could be leading to only certain changes to submodules
> behaving like this, but if anyone has any ideas -- including where I might
> start looking to gather useful information for a bug report, I'd be happy to
> provide what I can.

https://gerrit-review.googlesource.com/#/c/73221/
is the last change that touched both submodule as well as showing the
diff thereof.
IIUC, the version of JGit used is the crucial part and Gerrit just
tries to get along
with JGit weirdness.

So maybe there is a hint for the new weirdness? Maybe we did not pay
attention to
caching/glitches there?

Hi Stefan,

I think you may be onto something here: looking at how you emulate the old behavior in JGit, I realized if "Ignore whitespace" is set to none (with Intraline Diff on), I in fact see an entirely empty file, even with whole context on.  Now, in the failure mode, there are similar patches from the same time that don't have the empty file contents (they appear as normal differences), and both working and non-working cases have been observed on patches that existed before the upgrade from 2.11.2 to 2.12.2.  I'm not sure if we've observed the problem on any patches submitted following the upgrade, and Gerrit's online reindex was used during the upgrade to minimize downtime, but appeared to complete successfully.

--Doug

Doug Kelly

unread,
Jun 27, 2016, 11:27:17 PM6/27/16
to Jacob Keller, Repo and Gerrit Discussion, hugo...@ericsson.com, dpurs...@collab.net
Actually, it's not weird options at all.  These are the bog-standard side-by-side diff preferences.  You're right; I recall earlier (i.e. <2.10) versions used Unified Diff for displaying submodule changes, I think... but they've been displayed as "files" in recent versions.  2.10 broke the legacy behavior of displaying submodule diffs.  2.11 "fixed" that behavior, and now in 2.12 while the diff appears most of the time, there's a few one-off cases that don't display the diff.  (With the same preferences, the bug is not always reproducible on different changes -- but if you can reproduce it on one change, it's reproducible on that change 100% of the time.)

On Mon, Jun 27, 2016 at 9:18 PM Jacob Keller <jacob....@gmail.com> wrote:
Prior to that commit we didn't show submodule diffs as side-by-side,
so it is likely some cause behind a weird mix of these options, so you
don't ignore whitespace, and you do ask for intraline diff?

Jacob Keller

unread,
Jun 28, 2016, 1:19:56 AM6/28/16
to Doug Kelly, Repo and Gerrit Discussion, hugo...@ericsson.com, dpurs...@collab.net
Prior to that commit we didn't show submodule diffs as side-by-side,
so it is likely some cause behind a weird mix of these options, so you
don't ignore whitespace, and you do ask for intraline diff?

>>
>>

Jacob Keller

unread,
Jun 28, 2016, 1:47:51 AM6/28/16
to Doug Kelly, Repo and Gerrit Discussion, Hugo Arès, dpurs...@collab.net
On Mon, Jun 27, 2016 at 8:27 PM, Doug Kelly <doug...@gmail.com> wrote:
> Actually, it's not weird options at all. These are the bog-standard
> side-by-side diff preferences. You're right; I recall earlier (i.e. <2.10)
> versions used Unified Diff for displaying submodule changes, I think... but
> they've been displayed as "files" in recent versions. 2.10 broke the legacy
> behavior of displaying submodule diffs. 2.11 "fixed" that behavior, and now
> in 2.12 while the diff appears most of the time, there's a few one-off cases
> that don't display the diff. (With the same preferences, the bug is not
> always reproducible on different changes -- but if you can reproduce it on
> one change, it's reproducible on that change 100% of the time.)
>

I see. It's possibly caused by interactions from JGit and how gerrit
generates the side by side diff. I suspect we possibly somehow end up
not getting the contents of the submodule.
Reply all
Reply to author
Forward
0 new messages