hound-search/hound

ability to specify branches

Opened this issue ยท 14 comments

It'd be great if you could specify a branch to use for searching in the config. It'd be even better if you could do it on the fly in the UI

What would be better still is the ability to search in all branches (perhaps configurable on a per-repo basis if a given repo has many branches).

+1

Muffo commented

That would be very useful!

+1 - Would be super useful ๐Ÿ‘

Being able to search in multiple branches would be fantastic - this is the primary feature missing from Hound that prevents me from switching over from OpenGrok.

Being able to able to specify a specific branch to index would be greate, multiple would be awesome ! +1

+1
Failed to git fetch redis, output fatal: Couldn't find remote ref master

+1

There is also this PR with a different approach: #224

#275 provides the ability to specify a git branch other than the hardcoded "master" and it works for us.

#275 only adds the ability to specify one branch. Which still leaves room for improvement. I would like to be able to search on multiple branches in any repo. I tried changing the repo name for different branches using #275 but it doesn't work.
I am trying to port the patch https://github.com/caglar10ur/Hound/commit/a9208072a0444cd562592ca1bf348bf816ba4c2a to latest hound code to allow this functionality. But, I have no experience in go and it is proving to be a difficult task.
I think many people would like this functionality. Please use that patch as a starting position.

I have been able to index multiple branches but cannot search through them yet. Once my patch is complete I'll post it as a gist. (I have no experience in hg/bzr to send a MR with changes for those)

I have successfully adapted and tested a patch for specifying multiple branches in all the repos. I have also added an option to specify if user wants to search all branches or only master branch. Anyone interested can find the patch here:
https://gist.github.com/genuinelucifer/77346b81f79d2fdf3853fec16ef32fc0

What's the current state of this? I see the following:

  • #275 is still open
  • #345 was merged, and seems to cover the same thing
  • Lines in the example config that look like they could mean "autodetect default branch for all git repos"
    "vcs-config" : {
    "git": {
    "detect-ref" : true
    }
  • Lines in the example config that look like they could mean "set the branch for this repo" (although unclear if it's for only BitBucket repos)
    "vcs-config" : {
    "ref" : "main"
    }

Am I missing a file with specific documentation on the config?