Replies: 1 comment
-
I can see the same thing, however it is not clear to me what is going on in Git. Before I summarize what was found so far, let me explain how history cache creation works in OpenGrok: to avoid getting history for each file individually (which would take a very long time for the overall indexing), a trick is used for source code management systems that support getting history for directory. The indexer retrieves the history for the top-level directory of given repository, along with all the files that have changed in some way in each commit/revision. For Git, that would be something like Now, 63e74fdff18d4f7f5a859969ef984e37bf4a8fa7 is a merge commit, so that is not listed in history cache unless merge commits are explicitly enabled for indexer. It's parent is 1849ad5c5f367b11ba066b05ce662140e44d5c40 which is regular commit, changing the
There are 5501 commits in the history cache for that file. Plain
however when run with
So, it looks as if the history cache was generated with renamed file handling enabled, which it was not. Looking at the differences between commit IDs reported by There is another divergence at the beginning (or end, depending on how one is looking at the sequence). There is 1 extra commit - 05806d7af6 (
In that changeset, the I'm afraid this brings more questions than answers. In particular, why does Git consider the file renamed and why is there the longer commit divergence. The ultimate question would be if the indexer could do something differently. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I have a public git project indexed and checked out at master branch. This branch point to the commit
e54084b5d1542187e5b8560f9f29e372680f4052
. But when I browse through the project and open a file namedcore/build_id.mk
I got the following URL:source/xref/build-ori/core/build_id.mk?r=390c2376
The revision id does not match to project HEAD. That is ok because this revision comes from
core/build_id.mk
history, right? Yes, but if I check this file history I got a diff top commit id, which is63e74fdff18d4f7f5a859969ef984e37bf4a8fa7
. Checking the project history I can see that file revision get by opengrok (390c2376) is far above the true file top commit (63e74fdf). Checking opengrop file history page, I see changes that are not really related to the file.It would be a minor issue if my code was not indexed with "
--economical
" flag. With this flag, opengrok generate a dynamic page to show file content, and since it use the "wrong" revision (390c2376), file content is also wrong:workspace file last line:
BUILD_ID=AOSP.MASTER
Last line from opengrok webapp (source/xref/build/core/build_id.mk?a=true&r=390c2376)
BUILD_ID=TQ1A.230205.002
Is there any way to check how opengrok get this revision?
To Reproduce
Clone public repository:
git clone https://android.googlesource.com/platform/build
Checkout master branch:
git checkout master
Index command:
/opengrok/opengrok-tools/bin/opengrok-indexer --java /tools/jre/bin/java --java_opts=-server --java_opts=-Xmx24g --java_opts=-Dorg.opengrok.indexer.history.git=/bin/git --jar /opengrok/lib/opengrok.jar -- --ctags /tools/ctags/ctags --dataRoot /opengrok/data -i d:.repo -i d:.git -H --projects --depth 50 --source /opengrok/src_root --search --writeConfig /opengrok/configuration.xml --progress --economical
Expected behavior
When dynamic page is generated, file content should be the same as the file in git workspace (disk)
Additional context
Beta Was this translation helpful? Give feedback.
All reactions