Giter VIP home page Giter VIP logo

Comments (6)

hanwen avatar hanwen commented on May 12, 2024

yeah, this could have been the go-git transition. The relevant code would be under gitindex, and there is an option BranchPrefix that should hold refs/heads/ . The prefix should not go into the actual branch name, afaict:

https://gerrit.googlesource.com/zoekt/+/f3e8b54db17ec67f8108123bac197194f51d1288/gitindex/git.go#342

maybe expandBranches doesn't behave as expected?

from zoekt.

GLundh avatar GLundh commented on May 12, 2024

Sven made a match which seems to work for us:

https://gerrit-review.googlesource.com/c/zoekt/+/137410

from zoekt.

hanwen avatar hanwen commented on May 12, 2024

can you tell me more about the failure mode? I can't reproduce the problem.

$ git clone --mirror https://gerrit.googlesource.com/zoekt
$ cd zoekt.git
$ git show-ref|grep master
e255527 refs/heads/master
$ zoekt-git-index --branches=master .
2017/11/05 14:03:11 finished /home/hanwen/.zoekt/gerrit.googlesource.com_zoekt_v14.00000.zoekt: 1261902 index bytes (overhead 3.4)

from zoekt.

GLundh avatar GLundh commented on May 12, 2024

That will work because the default -prefix is "refs/heads/".

Since we index Gerrit configurations (refs/meta/config) we need to set "-prefix" to an empty string or else we cannot index the "refs/meta/"-branches.

Pre go-git.v4 we could set -prefix to "" and it would still find and index a ref like "master". That way we could index both "master" (not "refs/heads/master") and "refs/meta/config", which was perfect for us.

Since go-git.v4, zoekt-git-index wont find "master" anymore with -prefix "", so we have to specify the full branch ref: "refs/heads/master" which clutters the UI (and I guess affect the searches).

I guess people that index refs/notes and similar namespaces will have the same problem.

from zoekt.

sselberg avatar sselberg commented on May 12, 2024

This problem is solved by this patch:
https://gerrit-review.googlesource.com/c/zoekt/+/137410

from zoekt.

hanwen avatar hanwen commented on May 12, 2024

fixed by e1a95db

from zoekt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.