Skip to content

Follow file renames #998

Closed
Closed

Description

@SimenB

Issuehunt badges

Sort of like git log file vs git log --follow file. There is https://github.com/staff0rd/github-follow-extension, but I couldn't get it to work, and not having yet another extension would be awesome.

Sorry if there is an issue for this already, I was unable to find it.

Example file: https://github.com/facebook/jest/commits/master/packages/jest-cli/src/coverage.template

$ git log --oneline packages/jest-cli/src/coverage.template
0c9d2b6e packages/jest-cli
$ git log --oneline --follow packages/jest-cli/src/coverage.template
0c9d2b6e packages/jest-cli
d612ea12 Move coverage template to non-js file
ce5c2ebc Lint fixes
8efc492a Use eslint for linting
88a94d5d FIRST!

For anyone that wants this, please also send this feature request to GitHub: [email protected]

bfred-it earned $80.00 by resolving this issue!

Activity

  1. sindresorhus commented on Jan 14, 2018

    @sindresorhus
    Member

    I can't believe GitHub doesn't do this built-in. I've sendt many requests for this through the years, but of course, nothing happened. Would be cool to have, but not sure it's possible just with the website and APIs.

  2. fregante commented on Jan 14, 2018

    @fregante
    Member

    This should be possible by

    1. fetching the oldest commit on that page
    2. looking for a rename of the current file (in this case src/coverage.template → packages/jest-cli/src/coverage.template)
    3. adding a link to https://github.com/facebook/jest/commits/master/src/coverage.template

    Edit: I looked into API v3 and v4 and they don't offer the option follow the rename either.

  3. added
    Please! ♥︎
    on Mar 5, 2018
  4. fregante commented on Feb 17, 2019

    @fregante
    Member

    v3 solution (v4 doesn't support it)

    async function findRename(user, repo, lastCommitOnPage, currentFilename) {
    	const response = await fetch(`https://api.github.com/repos/${user}/${repo}/commits/${lastCommitOnPage}`);
    	const content = await response.json();
    
    	for (const file of content.files) {
    		if (file.filename === currentFilename) {
    			return `https://github.com/${user}/${repo}/commits/${content.parents[0].sha}/${file.previous_filename}`
    		}
    	}
    }
    // Example:
    // https://github.com/sindresorhus/refined-github/commits/master/source/features/copy-on-y.tsx
    await findRename('sindresorhus', 'refined-github', '11b927189bab258a226e251c1bd87504feee51f4', 'source/features/copy-on-y.tsx')
    // https://github.com/sindresorhus/refined-github/commits/f25483fa128d9dcc8e1e74fcf2d2751d604fe11f/source/features/copy-on-y.js

    Someone package it up! 😄

    It would be nice if the disabled Older button on the page is reactivated and is set to this link. Perhaps it should also be changed to Older (renamed)

    Same goes for Newer in the opposite direction

  5. IssueHuntBot commented on Mar 21, 2019

    @IssueHuntBot

    @IssueHunt has funded $80.00 to this issue.


  6. self-assigned this
    on Mar 22, 2019
  7. IssueHuntBot commented on Mar 28, 2019

    @IssueHuntBot

    @sindresorhus has rewarded $72.00 to @bfred-it. See it on IssueHunt

    • 💰 Total deposit: $80.00
    • 🎉 Repository reward(0%): $0.00
    • 🔧 Service fee(10%): $8.00
  8. simonkotwicz commented on Apr 6, 2019

    @simonkotwicz
    Contributor

    This feature doesn't seem to work on GHE (tested on 2.16.4).

  9. busches commented on Apr 6, 2019

    @busches
    Member

    @simonkotwicz I haven't tried it yet, but is it throwing an error of any sorts?

  10. simonkotwicz commented on Apr 6, 2019

    @simonkotwicz
    Contributor

    ya I do see

    ❌ branch-buttons
    content.js:1689 TypeError: Cannot read property 'textContent' of null
        at getTagLink (content.js:3549)
        at async Promise.all (index 1)
        at async branch_buttons_init (content.js:3593)
        at async features_run (content.js:1684)
    
  11. busches commented on Apr 6, 2019

    @busches
    Member

    That error is not this feature though. 😀 You can open a different issue for that error, please include GHE version, etc.

  12. 5 remaining items

  13. onassar commented on Jan 8, 2021

    @onassar

    I've got the extension installed, but when I'm looking at the file through GitHub, I can't seem to find the old history (I assume, it would be found by clicking on the History link for the file?)

  14. yakov116 commented on Jan 8, 2021

    @yakov116
    Member

    Yes it would be under history. If a file is rename the "next" button will lead you to the renamed file

  15. onassar commented on Jan 8, 2021

    @onassar

    Strange. The button isn't showing up for me. Do you have a screenshot you could show me that shows where it would be?

  16. yakov116 commented on Jan 8, 2021

    @yakov116
    Member

    What page are you looking at?

  17. onassar commented on Jan 8, 2021

    @onassar

    A page like the following:
    https://github.com/onassar/repo-name/commits/branch-name/path/to/file.css

  18. yakov116 commented on Jan 8, 2021

    @yakov116
    Member

    Do you have an actual link I can test on?

  19. onassar commented on Jan 8, 2021

    @onassar

    It's in a private repo unfort. Do you have a public link that's working for you? I can try it out and confirm

  20. simonkotwicz commented on Jan 8, 2021

    @simonkotwicz
    Contributor

    (make sure your have a personal GitHub token set in the extensions options)

  21. onassar commented on Jan 8, 2021

    @onassar

    Ahh okay that's required? I tried to read through things and assumed the token wasn't required for that to work.

  22. yakov116 commented on Jan 8, 2021

    @yakov116
    Member

    For any api interaction on a private repo you will need a token

  23. onassar commented on Jan 8, 2021

    @onassar

    Okay thanks. Which specific permissions are required for that feature?

  24. yakov116 commented on Jan 8, 2021

    @yakov116
    Member

    The repo

  25. onassar commented on Jan 8, 2021

    @onassar

    Sorry to be pedantic, but which settings in repo? I don't want to grand the extension more settings than it needs. Does it need all of them?

  26. fregante commented on Feb 3, 2021

    @fregante
    Member

    If you want to use it in a private repo, repo is the only scope you need. Unfortunately repo includes everything else under it.

    For public repositories you probably don't need any scopes since the token already allows read-only access to all public repositories.

  27. onassar commented on Feb 3, 2021

    @onassar

    Okay gr8 thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Please! ♥︎acceptedenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions