GithubHelp home page GithubHelp logo

pomber / git-history Goto Github PK

View Code? Open in Web Editor NEW
13.5K 138.0 530.0 32.36 MB

Quickly browse the history of a file from any git repository

Home Page: https://githistory.xyz/

License: MIT License

HTML 2.36% JavaScript 94.08% CSS 3.56%
git github history commit blame animation text log cli vscode

git-history's Introduction

Quickly browse the history of files in any git repo:

  1. Go to a file in GitHub (or GitLab, or Bitbucket)
  2. Replace github.com with github.githistory.xyz
  3. There's no step three

Try it

If you like this project consider backing my open source work on Patreon!
And follow @pomber on twitter for updates.

Extensions

Browsers

You can also add an Open in Git History button to GitHub, GitLab and Bitbucket with the Chrome and Firefox extensions.

Or you can use a bookmarklet.
javascript: (function() {
  var url = window.location.href;
  var regEx = /^(https?\:\/\/)(www\.)?(github|gitlab|bitbucket)\.(com|org)\/(.*)$/i;
  if (regEx.test(url)) {
    url = url.replace(regEx, "$1$3.githistory.xyz/$5");
    window.open(url, "_blank");
  } else {
    alert("Not a Git File URL");
  }
})();

Local Repos

You can use Git History for local git repos with the CLI or with the VS Code extension.

Support Git History

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

selefra

Backers

Thank you to all our backers! 🙏 [Become a backer]

Contributors

This project exists thanks to all the people who contribute.

Thanks

BrowserStack for letting open source projects use their services for free. Now I can test, debug and fix Safari issues from my Chrome running on Linux!

Credits

Based on these amazing projects:

License

MIT

git-history's People

Contributors

ahmedkamal20 avatar armanio avatar arminkhodaei avatar bchristie avatar bhacaz avatar filips123 avatar iaziz786 avatar izeye avatar matt-watson90 avatar monkeywithacupcake avatar pomber avatar porterdarby avatar rochesterinnyc avatar shayanb avatar szczerski avatar tkwant avatar yershalom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-history's Issues

Unable to view history in private repos

When viewing a file from a private repo, I get a "File not found" error.

There are a couple cases here.

Repo is private - "File not found"

Repo is public, open file, make repo private - File opens, files not accessed while repo is public- "File not found"

This is not an a bug

This is one of the most helpful tools in recent times. I really loved it. Thank you for building this ✌️ 🔥

Improve visualization of small inline changes

Currently, the animation slides each changed line out of the way to replace it with the new version. However, this means small changes (e.g. one character changes) will look like entire line changes, and it will be hard to tell the difference between the old line and the new line.

Support branches named with '/' in them

Pat on the back
Kudos to you. I'd like to provide links like this in my PR so that folks can quickly see file history. I've wanted something like this. A past source control system had something like this.

Issue
Files in a branch named with a '/' cannot be loaded. For example, a branch named "mm/config" cannot be loaded.

Add three columns for code

column1 --------------------------column2 ------------------------------------------column3
code in commit1..................code in commit2........................................change in commit3

currently, only code in commit2 is shown. It is hard to know what has been changed or changed to exactly.

Make theme configurable

I love the visual and transition but there is something that is missing.
I am person who works better with black and white text.
Is there a possibility to add different themes to it.

Create browser extension based on this

It would be really neat to have this as a Chrome extension. This way I believe it would be possible to use this in private repos, and I guess it could be faster too.

[VS Code] Error: Running the contributed command:'extension.git-file-history' failed.

Hi folks, I just installed the extension and when trying to see the history of a file I get the following error:

notificationsAlerts.ts:38 Error: Running the contributed command:'extension.git-file-history' failed.
    at e._executeContributedCommand (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:486:51)
    at e.$executeContributedCommand (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:486:443)
    at t._doInvokeHandler (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:644:118)
    at t._invokeHandler (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:643:744)
    at t._receiveRequest (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:642:322)
    at t._receiveOneMessage (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:641:155)
    at c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:638:960
    at c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:38:994
    at e.fire (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:113)
    at a (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:170:213)
    at Socket.f._socketDataListener (c:\Users\MyUser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:170:434)
    at Socket.emit (events.js:182:13)
    at Socket.EventEmitter.emit (domain.js:442:20)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onread (net.js:636:20)
t.onDidNotificationChange @ notificationsAlerts.ts:38
(anonymous) @ notificationsAlerts.ts:26
e.fire @ event.ts:567
t.notify @ notifications.ts:113
t.error @ notificationService.ts:48
t.onError @ commandsHandler.ts:325
(anonymous) @ commandsHandler.ts:310
_tickCallback @ internal/process/next_tick.js:68
Promise.then (async)
(anonymous) @ commandsHandler.ts:306
setTimeout (async)
t.runAction @ commandsHandler.ts:296
t.run @ commandsHandler.ts:280
e.run @ quickOpenModel.ts:583
t.elementSelected @ quickOpenWidget.ts:556
(anonymous) @ quickOpenWidget.ts:235

[CLI] Parser error with regexp containing $ character

Reproduction:

  1. Commit the following file:
def _parse_uppercase(self):
    p = re.compile(r'^([A-Z0-9_]+)+_.*$')
    m = p.match(self._name())
    return m.group(1) if m else self._name()
  1. Open via git-file-history
  2. The history page is broken: no commiters and only some parser-leftover code. Then the Git History README is being shown:
    image

Incorrect prism component for Dockerfiles

Example: https://github-history.netlify.com/porterdarby/istanbul-tools-docker/blob/master/Dockerfile

The page errors out and produces this in the console:

index.js:30 Error: Cannot find module './prism-dockerfile'
    at  groupOptions: {} namespace object:2439

I think this is because prism has a list of components and the component that you should be loading is prism-docker instead of prism-dockerfile.

FIX: Put in an issue/PR with Prism to rename the file OR put in a one-off for docker -> dockerfile OR have a catchall for no syntax highlighting.

Blame column

  • A blame column could be turned on at the left, showing output from git blame.
  • When hovering over a line in the blame column, the main window shows the historical version of the file when the commit was born. The whole commit message appears in a bubble on the left (even more left).
  • When it is clicked, the timeline jumps there.

Fisheye on hover.

It would be great if the text size was tiny so you could see large files with a type of fisheye zoom (read larger font size) on mouse hover.

Hard to use on mobile

It probably wasn't designed for mobile usage but it does work... Kind of. It works but you can only traverse the history by tapping on either edge side of the top bar.

Using Firefox mobile

Change animation

The current animation of sliding content in and out laterally is visually interesting, but I wonder if it would be more semantically suggestive to use a folding/accordion animation, whereas deleted code is vertically compressed out of existence, and new code expands out in the opposite way.

For lines that are changed, I'd envision this to produce an effect similar to a slot machine or a cube rolling back.

Not sure if I'm describing the effect in a clear way. Does the above make any sense?

[VS Code] Blank screen

After updating to 0.1.0 I can now see a little bit more when using the extension (I use to get this error), but I still can't see the file history.

This is whay my screen looks like:

image

The screen just stays with that background and the little text on the buttom left corner, but doesn't start.

This is the content of the log file:

[2019-02-20 08:07:35.991] [exthost] [info] eager extensions activated
[2019-02-20 08:07:35.996] [exthost] [info] ExtensionService#_doActivateExtension pomber.git-file-history {"startup":false,"activationEvent":"onCommand:extension.git-file-history"}
[2019-02-20 08:07:35.996] [exthost] [info] ExtensionService#loadCommonJSModule C:\Users\fcano\.vscode\extensions\pomber.git-file-history-0.1.0\extension.js

I'm running VSCode on Windows 10. I should be on the latest version of both platforms since they update often.

[GitHub] Unauthorized issue after revoke.

I granted access and it was added to my application then I wanted to request access for one of the organizations I'm working at, I couldn't find any option to do that so I revoked the app from my github settings. When I tried to grant access again it gives me Unauthorized error in the console.

URL params to start from beginning, auto play

Would be great to be able to link people to a file and have it start from the beginning of the history (or to be flexible, a specific commit). I like showing the progression of the file, which you can't do going backwards.

It would also be nice to auto step through the history with a user defined interval.

These could be controlled with URL params.

Unexpected error when tried to load a *.bat file in a private repository.

This is what I got, when I tried on a random file in a private repo in our organization (github entity).
image
I mean I didn't expect it to work, but it says to report the issue, so here I am.

I tried a different file in the same repository, and now it says this:
image

This leads me to being a bit more specific. The exact URL i tried is:
https://github.githistory.xyz/KenticoInternal/draft-client/blob/master/autostart.bat

To be clear, there is 'some' history with this file:
image

[CLI] Only display part of git history

image
Above is real git history displayed by tortoise.
When I use

git-file-history Application/DataService/Logic/RefundLogic.class.php

can only display 2 commit records in 2016
image

A Bookmarklet for githistory.xyz

Here is a Bookmarklet to open githistory.xyz automatically instead of typing in the URL.

javascript:(
    function(){
        var url = window.location.href;
        var reg = new RegExp("^(https?\:\/\/)(www\.)?github\.com\/?(.*)$");
        if (reg.test(url)) {
            url = url.replace(/(https?\:\/\/)(www\.)?github\.com\/?(.*)/i, "$1github.githistory.xyz/$3");
        } else {
            console.log("Not Github.com URL");
        }
        window.open(url, '_blank');
    }
)();

Updated Version below

Support GitLab & Bitbucket

It would be nice to have support for gitea (or the gogs, the fork it inherited from) and/or gitlab.

Or, what would be even better because both are open source, even integrate github-history in them.

[VS Code] file path issue

[2019-02-15 20:28:34.128] [exthost] [error] Error: ENOENT: no such file or directory, open '/c:/Users/xxxxx/.vscode/extensions/pomber.git-file-history-0.0.2/site/index.html' at Object.fs.openSync (fs.js:577:3) at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:166:20) at Object.fs.readFileSync (fs.js:483:33) at Object.exports.wrapFsWithAsar.fs.readFileSync (ELECTRON_ASAR.js:563:29) at c:\Users\xxxxx\.vscode\extensions\pomber.git-file-history-0.0.2\extension.js:44:24 at e._executeContributedCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:485:959) at e.$executeContributedCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:486:443) at t._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:644:118) at t._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:643:744) at t._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:642:322) at t._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:641:155) at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:638:960 at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:38:994 at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:113) at a (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:170:213) at Socket.f._socketDataListener (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:170:434) at Socket.emit (events.js:182:13) at addChunk (_stream_readable.js:279:12) at readableAddChunk (_stream_readable.js:264:11) at Socket.Readable.push (_stream_readable.js:219:10) at Pipe.onread (net.js:636:20) extension.git-file-history

'/c:/Users/xxxxx/.vscode/extensions/pomber.git-file-history-0.0.2/site/index.html' -> wrong
'c:/Users/xxxxx/.vscode/extensions/pomber.git-file-history-0.0.2/site/index.html' -> correct

[CLI] UnhandledPromiseRejectionWarning when file was renamed

I got the following error when using the cli command on a file:

$ npx git-file-history  frontend-nuxt/components/project-index/Project.vue 
npx: installed 36 in 2.806s
Running at http://localhost:3000
(node:46252) UnhandledPromiseRejectionWarning: Error: Command failed: git show 8f85d56:frontend-nuxt/components/project-index/Project.vue
fatal: Path 'frontend-nuxt/components/project-index/Project.vue' exists on disk, but not in '8f85d56'.


    at makeError (/Users/lhermann/.npm/_npx/46252/lib/node_modules/git-file-history/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/lhermann/.npm/_npx/46252/lib/node_modules/git-file-history/node_modules/execa/index.js:278:16)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:46252) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:46252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I investigated and found out that this commit mentions the file, but it was renamed:

$ git log -M --summary 8f85d56
commit 8f85d567cd4dee018dd5146e6f2001ef245f467b
Author: Lukas Hermann <[email protected]>
Date:   Tue Feb 12 19:32:20 2019 +0800

    feat: make project list universaly usable [E4A-78]

 create mode 100644 frontend-nuxt/components/project-index/ProjectCompact.vue
 rename frontend-nuxt/components/project-index/{Project.vue => ProjectDefault.vue} (93%)
 create mode 100644 frontend-nuxt/components/project-index/index.vue

Looks like git-history can not handle this. Probably a bug?

How to deploy ?

I tried to wrap this project as a docker image, in fact it was able to run, but since I was using my own domain name; I had a problem with Github OAuth2 authorization:

The page always prompts me to log in to Github (OAuth2 authorization). When I click the button, I am prompted to authorize the success, but the page does not reflect anything; I observed that the authorization callback address does not seem to be my own domain name.

update changes

Collaborative projects pull other people's new code without seeing the latest changes

VS Code extension

It would be awesome to have this as a VS Code extension. Is it possible?

Add a file navigation for an entire repo

Instead of navigating the history of a single file, add a way to navigate the history of an entire repo. File by file.

I'm imagining a navigation bar on the side so you can select different files etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.