Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Apr 19, 2023

Conversation

awf
Copy link
Contributor

@awf awf commented Apr 13, 2023

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)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

The PR fulfills these requirements:

  • All tests are passing?
  • New/updated tests are included?
  • If any static assets have been updated, has ui/bindata.go been regenerated?
  • Are there doc blocks for functions that I updated/created?

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

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Copy link
Contributor

@salemhilal salemhilal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems easy and reasonable! Let me get approval from some of the other maintainers before merging it. Thank you for contributing!

CONTRIBUTING.md Show resolved Hide resolved
config-example.json Outdated Show resolved Hide resolved
Copy link
Contributor

@jvt jvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, awesome quality-of-life improvement! Thank you for contributing!

@jvt jvt merged commit 445500b into hound-search:main Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants