-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Further improve branch getter function #4187
Closed
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
f6630c5
Fix GitHubURL - excluding PR Files
yakov116 cb1e4f3
Fix tests
yakov116 ca22fb3
Please check for typo before committing
yakov116 c80fb13
Fix it for now
yakov116 eb24a4d
Merge remote-tracking branch 'upstream/githuburl' into githuburl
yakov116 db42e67
One BIG Mess
yakov116 83e4980
Lets use the title
yakov116 2a58301
Merge remote-tracking branch 'upstream/main' into githuburl
yakov116 4401857
Start fixing
yakov116 69ef080
Merge branch 'main' into githuburl
yakov116 659e62e
fix some more
yakov116 1a04cdd
Exclude pr files
yakov116 1ca241a
Merge branch 'main' into githuburl
yakov116 04b7396
Fix some more
yakov116 9e70957
Fix test for now
yakov116 44e1a11
Merge remote-tracking branch 'sindresorhus/main' into githuburl
yakov116 296b022
More cleanup
yakov116 4254949
Move to its own file
yakov116 7496845
Fix test
yakov116 068b21b
Small fix
yakov116 38bb092
Update comment
yakov116 a673cb3
Lint
yakov116 6318630
Lint
yakov116 f4f8601
Fixup `more-dropdown`
yakov116 179db54
Lint
yakov116 e0e4364
Fix `latest-tag-button`
yakov116 a636300
Add `get branch and filePath from search` test
yakov116 c6ff873
Update source/github-helpers/index.ts
yakov116 bc9d068
Update source/github-helpers/index.ts
yakov116 8b3efcb
Update source/features/more-dropdown.tsx
yakov116 89b91a6
Not sure what I did here
yakov116 2f4b63c
Add comment
yakov116 146190a
Undo TS change
fregante 315f2ab
Update default slashed branch test
fregante f43511d
Use correct /find/ URL
fregante dbd0afc
Waiting for element-ready@6
fregante ccaeeef
Restore index.tsx
fregante 5961155
Merge remote-tracking branch 'upstream/main' into githuburl
yakov116 62e24d3
Revert "Move to its own file"
yakov116 586361b
Fix import
yakov116 17381b8
Move TODO date
yakov116 c9b0af6
Merge branch 'main' into githuburl
yakov116 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -221,15 +221,17 @@ test('getCurrentCommittish', t => { | |||||||
'github.com' | ||||||||
)); | ||||||||
|
||||||||
document.head.insertAdjacentHTML('beforeend', '<a data-hotkey="t" href="https://github.com/typescript-eslint/typescript-eslint/find/cool%2Fdefault%2Fbranch"></a>'); | ||||||||
// Root | ||||||||
t.is(getCurrentCommittish( | ||||||||
'/typescript-eslint/typescript-eslint', | ||||||||
'typescript-eslint/typescript-eslint: Monorepo for all the tooling which enables ESLint to support TypeScript' | ||||||||
), undefined); | ||||||||
), 'cool/default/branch'); | ||||||||
t.is(getCurrentCommittish( | ||||||||
'/typescript-eslint/typescript-eslint/tree/chore/lerna-4', | ||||||||
'typescript-eslint/typescript-eslint at chore/lerna-4' | ||||||||
), 'chore/lerna-4'); | ||||||||
document.querySelector('[data-hotkey="t"]')!.remove(); | ||||||||
|
||||||||
// Sub folder | ||||||||
t.is(getCurrentCommittish( | ||||||||
|
@@ -289,7 +291,7 @@ test('getCurrentCommittish', t => { | |||||||
t.is(getCurrentCommittish( | ||||||||
'/typescript-eslint/typescript-eslint/commits/chore/lerna-4/docs/getting-started/README.md', | ||||||||
'History for docs/getting-started/README.md - typescript-eslint/typescript-eslint' | ||||||||
), 'chore'); // Wrong, but | ||||||||
), 'master'); // Uses the feedlink | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only shows that the test is wrong, and thus useless. For this to be tested correctly, it should have the correct feedLink, added and removed just for this test like we do for
Suggested change
|
||||||||
|
||||||||
// Single commit | ||||||||
t.is(getCurrentCommittish( | ||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would this link have a file path but not a branch? Steps to reproduce please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/yakov116/refined-github/commits/f23b687b3b89aa95a76193722cdfeff740646670?after=f23b687b3b89aa95a76193722cdfeff740646670+34&path%5B%5D=source&path%5B%5D=features&path%5B%5D=release-download-count.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steps to find find that link on GitHub.com. That's just a URL that anyone can write manually but maybe doesn't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the url we were testing until now. The branch in the path is a new thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That URL does not have a
branch
URL parameter (branchFromSearch
). Where did you see that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I wanted:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, this confirms that there's no way that
filePathFromSearch
is truey whilebranchFromSearch
isn't, so it should probably beThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GHE. The branch part is a new thing (at least it was not there when we made GitHubURL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the
pathname
look exactly like now too? Because we can easily extract the slashed branch from there instead, and not use thebranch
parameter at all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it did.