searchcode-server icon indicating copy to clipboard operation
searchcode-server copied to clipboard

Index branches & tags

Open olivierboudet opened this issue 8 years ago • 5 comments

Hello,

Thanks for your work on this tool. Would it be possible to index branches & tags to avoid manually add multiple instances of the same repository in the admin (pointing to different branches...) ?

Thanks

olivierboudet avatar Feb 01 '17 08:02 olivierboudet

No problem. If you like it please support it by purchasing a copy!

As to your request, you mean would it be possible to add a single repository and then have it index each branch? Say I add https://github.com/boyter/searchcode-server.git and say I want to index branches master, history and spelling?

Certainly possible. Its something I have wanted to do actually once I refactor the indexing code. I add it as an enhancement so I can keep track of it and see if I can add it in. Might be a good idea to do this before the historical search I suppose.

boyter avatar Feb 01 '17 21:02 boyter

As to your request, you mean would it be possible to add a single repository and then have it index each > branch? Say I add https://github.com/boyter/searchcode-server.git and say I want to index branches master, history and spelling?

Yes, exactly.

olivierboudet avatar Feb 04 '17 08:02 olivierboudet

Seems reasonable. I will have a ponder on how best the achieve this. The only issue I can see is that you will probably see a lot of duplicate code results when you search. I will have to implement some collapse logic for duplicates. Something to consider.

boyter avatar Feb 04 '17 10:02 boyter

You are right, perhaps admin can set a default branch for the repository and others branches or tags could be suggested in search results ?

olivierboudet avatar Feb 04 '17 10:02 olivierboudet

I can see a few ways to do it.

  1. Display the results as is
  2. Merge the results and display something to the effect of (3 others found) or something similar
  3. As you say add a default and have the others suggested

One real issue is with the way the index is currently built. It assumes a single branch per repository, and that is what is currently displayed in the UI when showing results.

I have a few ideas on how to solve this, just need to work through them before doing an implementation.

For the moment though if you want this you can do it by duplicating the repository with different names and adding the different branches, so there is a workaround at the moment and this is more of a "nice to have" UI feature more then anything else.

boyter avatar Feb 05 '17 11:02 boyter