hound-search / hound

Lightning fast code searching made easy
MIT License
5.68k stars 578 forks source link

Add `display-name` option to customize/disambiguate output #454

Closed awf closed 1 year ago

awf commented 1 year ago

This PR introduces an optional display-name field in the repo configuration, which allows the user to override the default parent/repo format. This is useful, for example, when indexing the same repo with different config options (e.g. main branch and feature branch).

E.g. this config file:

{
  "dbpath" : "db",
  "vcs-config" : {
    "git": {
      "ref" : "main"
    }
  },
  "repos" : {
    "Hound" : {
      "url" : "https://github.com/awf/hound.git"
    },
    "Hound/alpine" : {
      "url" : "https://github.com/hound-search/hound.git",
      "display-name" : "Hound (alpine)",
      "vcs-config" : {
        "git": {
          "ref" : "alpine"
        }
      }
    }
  }
}

produces this output (the red text) from the CLI client image

and this on HTML image

What kind of change does this PR introduce? (check at least one)

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

Other information: