Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sroomberg-ep committed Jan 13, 2025
2 parents 4cbc3cf + 6480072 commit 0015b55
Show file tree
Hide file tree
Showing 6 changed files with 1,650 additions and 254 deletions.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,23 @@ node_modules/build:
.build/bin/hound: $(SRCS)
go build -o $@ github.com/hound-search/hound/cmds/hound

<<<<<<< HEAD
ui/.build/ui: node_modules/build $(UI)
mkdir -p ui/.build/ui
cp -r ui/assets/* ui/.build/ui
||||||| 6249481
.build/bin/go-bindata:
GOPATH=`pwd`/.build go get github.com/go-bindata/go-bindata/...

ui/bindata.go: .build/bin/go-bindata node_modules $(wildcard ui/assets/**/*)
rsync -r ui/assets/* .build/ui
=======
.build/bin/go-bindata:
GOPATH=`pwd`/.build go install github.com/go-bindata/go-bindata/...

ui/bindata.go: .build/bin/go-bindata node_modules $(wildcard ui/assets/**/*)
rsync -r ui/assets/* .build/ui
>>>>>>> merge_ours
npx webpack $(WEBPACK_ARGS)

dev: node_modules/build
Expand All @@ -37,7 +51,7 @@ test:

lint:
export GO111MODULE=on
go get github.com/golangci/golangci-lint/cmd/golangci-lint
go install github.com/golangci/golangci-lint/cmd/golangci-lint
export GOPATH=/tmp/gopath
export PATH=$GOPATH/bin:$PATH
golangci-lint run ./...
Expand Down
Binary file added ui/assets/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ui/assets/index.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>{{ .Title }}</title>
<link rel="shortcut icon" type="image/png" href="images/favicon.png" />
<link rel="stylesheet" href="css/octicons/octicons.css">
<link rel="stylesheet" href="css/hound.css">
<link rel="search" href="//{{ .Host }}/open_search.xml"
Expand Down
31 changes: 12 additions & 19 deletions ui/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function UrlParts(repo, path, line, rev) {
path = path || '',
port = '',
filename = path.substring(path.lastIndexOf('/') + 1),
anchor = line ? ExpandVars(pattern.anchor, { line : line, filename : filename }) : '';
anchor = line ? ExpandVars(pattern.anchor, { line : line, filename : filename, repo : repo }) : '';

// Determine if the URL passed is a GitHub wiki
var wikiUrl = /\.wiki$/.exec(url);
Expand All @@ -28,25 +28,18 @@ export function UrlParts(repo, path, line, rev) {
anchor = '' // wikis do not support direct line linking
}

// Hacky solution to fix _some more_ of the 404's when using SSH style URLs.
// This works for both github style URLs (git@github.com:username/Foo.git) and
// bitbucket style URLs (ssh://hg@bitbucket.org/username/Foo).
// Check for ssh:// and hg:// protocol URLs
// match the protocol, optionally a basic auth indicator, a
// hostname, optionally a port, and then a path
var ssh_protocol = /^(git|hg|ssh):\/\/([^@\/]+@)?([^:\/]+)(:[0-9]+)?\/(.*)/.exec(url);

// Regex explained: Match either `git` or `hg` followed by an `@`.
// Next, slurp up the hostname by reading until either a `:` or `/` is found.
// If a port is specified, slurp that up too. Finally, grab the project and
// repo names.
var sshParts = /(git|hg)@(.*?)(:[0-9]+)?(:|\/)(.*)(\/)(.*)/.exec(url);
if (sshParts) {
hostname = '//' + sshParts[2]
project = sshParts[5]
repoName = sshParts[7]
// Port is omitted in most cases. Bitbucket Server is special:
// ssh://git@bitbucket.atlassian.com:7999/ATLASSIAN/jira.git
if(sshParts[3]){
port = sshParts[3]
}
url = hostname + port + '/' + project + '/' + repoName;
// Check for bare git+ssh URIs (e.g., user@hostname:path
var bare_ssh = /^([^@]+)@([^:]+):(.*)/.exec(url);

if (ssh_protocol) {
url = '//' + ssh_protocol[3] + '/' + ssh_protocol[5];
} else if (bare_ssh) {
url = '//' + bare_ssh[2] + '/' + bare_ssh[4];
}

return {
Expand Down
Loading

0 comments on commit 0015b55

Please sign in to comment.