Git Product home page Git Product logo

le-git-graph's Introduction

Le Git Graph - Commits Graph for GitHub

A browser extension that displays the git graph for any GitHub repository.

Version Version Version Version

Demo

Demo Image

Installation

Install the extension from the link -

For Google Chrome, Opera, Vivaldi, Brave, and Microsoft Edge:

https://chrome.google.com/webstore/detail/le-git-graph-commits-grap/joggkdfebigddmaagckekihhfncdobff

For Mozilla Firefox:

https://addons.mozilla.org/firefox/addon/le-git-graph-github-git-graph/

After installation, open any GitHub repository and a new 'Commits' tab will be visible.

Open the commits tab and follow the prompt to authenticate with your GitHub account.

Setup for Private Repos owned by an Organization

Access to private repositories owned by an organization is restricted by default. To access the commits graph for such repositories, you need to follow the following steps.

  1. Go to https://github.com/settings/tokens
  2. Create a Personal Access Token (PAT) with the following scopes -
    • repo | Full control of private repositories
  3. Go back to the commits tab of a repo owned by the organization.
  4. From the dropdown for "Authorize with GitHub", select "Custom Personal Access Token".
  5. Enter the PAT and click on "Add PAT".

(Full access to repo is required to fetch the commits graph, because there is no read only access level for GitHub OAuth scopes as of now.)

Tech Stack

Client: JavaScript, Manifest V3

Server: GitHub GraphQL, GitHub OAuth, FireBase Cloud Functions

Features

  • Authentication with GitHub OAuth ✓
  • Connection to GitHub GraphQL ✓
  • Fetch the commits data from API ✓
  • Fetch further commits on demand ✓
  • Option to specify access level (public only or private too) ✓
  • Hover on the commit dot to see details ✓
  • Option to add custom PAT ✓
  • Filter the commits based on branch - Pending

Contact

Feel free to drop a mail at [email protected] or [email protected]

le-git-graph's People

Contributors

mboultoureau avatar nirmalscaria 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

le-git-graph's Issues

Formatting of the time stamp could be better

Screenshot 2022-11-04 at 5 13 11 AM

If the count is one, (1 hour, 1 day, etc), the unit should be singular. (1 hour. Not 1 hours.)
Additionally, if it is more than 3 days ago, better to write the actual commit date in some standard format rather than showing 6 days ago, 1 month ago, etc.
Further, "1 day ago" could be replaced with yesterday.

Show tags near commits

Is your feature request related to a problem? Please describe.
When looking at the graph, it is beneficial to see tags near commits. It will provide closer look as "git log --graph"

Describe the solution you'd like
To see tags along with commits. Only show tags attached to the commit. Not how github interprets them. The behavior should mimic "git log --graph"

Describe alternatives you've considered
git log --graph

Additional context
Add any other context or screenshots about the feature request here.

Add option to grant access to public repos only

First off; thanks so much for the Firefox support! Sadly though I immediately ran into a show-stopper. It seems the extension relies on authorizing an app to have access to ALL private repos across all my organizations. I only intend to use it for certain public repos though. Any chance the app requirement could be removed for public repo's? Or make the permission project or public project specific?

Basically, I have no desire to use this with private projects, so giving it access to them seems like a needless security risk I'd prefer avoiding.

Thanks!

Commits page opens after navigating away

Describe the bug
If you click away from the Commits tab before it loads, the commits tab opens back up

To Reproduce
Steps to reproduce the behavior:

  1. Go to Commits tab
  2. Before it loads, go to a different tab

Expected behavior
Commits tab should not open

Screenshots

Screen.Recording.2023-08-04.at.20.46.01.mp4

Version information:

  • OS: macOS
  • Browser: Brave
  • Version: 1.56.14 (Chromium: 115.0.5790.114)
  • Repository where this issue was observed: All

Allow Configuring a New Auth Server

This is an amazing extension, thank you for your hard work creating it! I would like to be able to use it for repos within my organization. Unfortunately calling out to a 3rd party server for authentication is a security risk.

If you had instructions for how to create an internal authentication server, then we could mitigate this risk. The plugin would also need a field to configure where to call to auth.

Please let me know your thoughts. Is this the internal auth setup something that's easy to document for others to recreate?

Thank you for you consideration.

Redesign the logo

The logo in the toolbar (tested with Firefox extension) doesn't look right on anything other than light mode:
image
All white on this icon should be made transparent instead.

Use the builtin commit history and pr history buttons.

This project is great. It should be the default way of showing commits.

Is your feature request related to a problem? Please describe.

With the chrome extension installed the main repo page now has two ways to see the commits:


history


One takes me to the le-git-graph, and the other takes me to the sad default view.

On PRs, there's no way to view the le-git-graph:


pr commits


Describe the solution you'd like

It would be great if these other places that show commits also showed the le-git-graph format.

Additional context

Thanks!

Loading too slow if too many branches

Describe the bug
If the repository contains too many branches, the first loading of commits tab takes too long. This is particularly visible if the number of branches is greater than 100, since that would mean waiting for another GraphQL request.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a repo with too many branches. ( https://github.com/flutter/flutter is a good example )
  2. Click on "Commits" tab (added by the extension)
  3. See error

Expected behavior
The loading should be way faster than this.

Screenshots
NA

Version information:

Additional context
This was known during the development times itself, and had no other option. There is no API from github that lists commits across all branches sorted by commit date. Either that, or an API that lists branches sorted by head commit date could solve this problem. AFAIK, neither exists and a fresh solution would be required.

Add tooltip on hovering commit circle

Display a tooltip upon hovering on the commit dot. Something along the lines of what is in this screenshot.
Not sure about what all contents to add. Few necessary ones are:

  • List of branches on which this commit is there.
  • Indication if this commit is the head of some branch.
  • Exact commit date and time

Looking for more significant items to add to this. Help and suggestions on what all to add to it are highly appreciated.

Screenshot 2022-11-27 at 10 08 33 PM

Firefox release failure

Describe the bug
The extension no longer updates on firefox, as the pipeline fails. Seems like firefox has made some changes to how service workers are handled. Packaging the extension manually and loading to firefox also doesn't seem to work.

To Reproduce
Steps to reproduce the behavior:

  1. Zip the extension
  2. Attempt to load it to firefox.

Expected behavior
The extension should load

Version information:

  • OS: [MacOS]
  • Browser [Firefoxi]
  • Version [1.2.8]

Additional context
I probably wont fix this, as firefox seems to be making too many changes with MV3, and it doesn't seem like the user base for firefox is large enough. (For this extension as well as firefox in general)
If any of you are in love with firefox and want to get this to work on firefox, please feel free to work on this issue and I will happy to get any fixes into the pipeline.

Stuck on authorisation page for organisation's private repos

I've set this extension up in my browser, and it works great for both my private and public repositories, but with the private repositories of my organisation, it just keeps asking me for authorisation. Currently circling this loop:

  • "Authorize Le Git Graph with GitHub to continue"
  • Authorize with GitHub (private and public repositories)
  • "Authorization completed!"
  • Done
  • Reload now
  • "Authorize Le Git Graph with GitHub to continue"

I've tried this with both Chrome and Firefox.

Is this a bug or a policy setting in the organisation that needs to be checked? I'm the owner, so should be able to sort it if so.

Access private repos without write access

Is your feature request related to a problem? Please describe.
I'd like to use this extension with private org repos, but I don't really trust giving write access.

Describe the solution you'd like
Improved OAuth to support organizations, or support for fine-grained PATs

Describe alternatives you've considered
None

Add First Run Experience (FRE) flow

Is your feature request related to a problem? Please describe.
The users might get confused where to find the graph and how to use it.

Describe the solution you'd like
Add first run experience (FRE) flow showing the features of the extension

Describe alternatives you've considered
Opening a web page with instructions on how to use the extension, but FRE will be more elegant.

Additional context
NA

Commit status icon incorrect

Describe the bug
The Le Git Graph commit graph page shows commit status checkmarks, Even when the commit status should indicate failed or absent. When clicking on the checkmark for these commits, it does display correctly that the checks have failed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a repo (a private repo in my case, using fine grained personal access tokens with metadata, content and commit status permissions)
  2. Click on the 'Commits' tab
  3. Look to the right of the commit date
  4. See the wrong commit status

Expected behavior
I expect commits with failed checks to show an ❌ and commits without any checks to not show a ❌ or ✔ at all

Screenshots
Le Git Graph commit graph page with wrong status:
afbeelding
And:
afbeelding

Commit page with correct commit status:
afbeelding

Version information:

  • OS: Windows 10
  • Browser: Firefox 116.0.3
  • Version: 1.2.0
  • A private repo

Additional context
As said above, I was using a new fine grained personal access token with metadata, content and commit status permissions with read-only access. I don't know if this has anything to do with the bug, but I'm mentioning this here just to be sure

Use (no-scope) for OAuth?

Is your feature request related to a problem? Please describe.

As issue #12 has already stated, requesting both read and write access when authenticating seems unnecessary.

Describe the solution you'd like

To somehow only request read access and maybe to not request anything when on a public repo as everything is public.

Describe alternatives you've considered

Now, I'm not at all well versed in GitHub OAuth but after reading about the different scopes GitHub provides it seems that (no-scope) could work.

bild

I don't know if "repository info" is enough but as public repos are open-source by nature and anyone can see the commit history of such a repo I don't see why an app couldn't do that. An alternative is to switch to a real GitHub app (instead of an OAuth app) where you can choose the amount of access more precisely and use their REST API.

bild

References used:

https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps
https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28

Branches in git graph are of same color (Red color with two concentric circles)

Describe the bug
Branches in git graph and legend on top right are all of same color. As a result its not possible to differentiate the branch in git graph and this impacts visualization.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://github.com/tensorflow/tensorflow'
  2. Ensure that the chrome extension is enabled and page is refreshed so that commit tab appears on github.
  3. Click on 'commits'
  4. See error

Expected behavior
3 Branch should have different color in legend (top right) and same color should be shown on git graph too.

Screenshots

Legend

GitGraph

Desktop (please complete the following information):

  • OS: [. Windows 11]
  • Browser [chrome Version 106.0.5249.120]

Does not show tagged commits outside of any branch

Describe the bug
Tagged commits outside of any branch is not shown in the graph.

To Reproduce
https://github.com/andry81/tacklebar

Expected behavior
Show tagged commits.

Screenshots
Screenshot from GitExtensions:
tagged-commits-graph

Version information:

I use tagged commits outside of any branch to freeze externals revisions in the file .externals for the vcstool. This is a convenient way to not touch any branch to freeze revisions. And no need to rewrite a branch to fix an external revision.

UI thread becomes unresponsive while loading commits

Description:
The app suffers from a performance issue where the page becomes unresponsive while loading more commits which seems to be exacerbated by poor internet and/or git repositories that have lots of branches.

Screenshot of bug

Possible fix:
Lengthy or blocking javascript code should be run on a web worker to prevent from blocking the UI. As I've looked through the code I noticed that async functions are used frequently, however these will still block the UI thread. Web workers are fairly limited in what they can do (for instance they can't modify the DOM) so the fix can be anywhere from simply rewriting a few async functions to use web workers to requiring a code rewrite with workers in mind. I'll need to look at the code some more to give a more definitive answer.

Version information:

  • Windows 10
  • Chrome 109.0.5414.120 (64 bit)
  • Le Git Graph 1.1.2

Support Github Enterprise Server

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
I cannot use this extensions with GHES using a custom domain

Describe the solution you'd like
A clear and concise description of what you want to happen.
To be able to enable domains other than github.com, such as refined-github/refined-github#450

Option for PAT based authentication

Due to security concerns I can not use this on private repositories, as it authenticate directly through your own server.

I suggest you rewrite the plugin to accept a personal access token (PAT), e.g. the same way as the popular Refined GitHub does. If so, a fine grained token could have been supplied, which is more security transparent.

Visual artifacts in long straight lines

To Reproduce
Steps to reproduce the behavior:

  1. Go to the specified repo and click on "Load more" a few times

Expected behavior
Expected a smooth straight line, got visible line segments

Screenshots
image

Version information:

Popup button should be an actual button

The button shown in the popup image should be removed and an actual button should be used instead. Having the whole image as a link is less obvious to the user because normal buttons change the cursor to indicate that they can be pressed.

firefox_n8V0TbEj0X

PAT storage and security

I'm wondering where and how the PAT is stored. How secure it is to give full access all repositories?

OAuth never granted - Authorizing Tree spins forever

Describe the bug
Tried to authorize to use Le Git Graph, window spins forever

Expected behavior
OAuth is authorized, and I can use the plugin.

Screenshots
image

Inspecting the code I have this in the Chrome inspector:

Failed to load resource: the server responded with a status of 500 ()
authorize/:1 Uncaught (in promise) SyntaxError: Unexpected token 'I', "Internal S"... is not valid JSON
    at JSON.parse (<anonymous>)
    at script.js:16:33
    at async sendAuthorisationRequestv2 (script.js:15:5)
authorize/:1 Uncaught (in promise) Error: 400: Invalid Token
    at tA (chrome-extension://difoiogjjojoaoomphldepapgpbgkhkb/background.js:5:17783)
    at async chrome-extension://difoiogjjojoaoomphldepapgpbgkhkb/background.js:1:62729

TODO: fix workflow `publish-firefox-add-on`

https://github.com/NirmalScaria/le-git-graph/actions/runs/7373480169/job/20062734590

IMPORTANT: web-ext v8 will introduce a new AMO submission API for signing and you might need to take actions when upgrading from v7 to v8. You can test this upcoming change now by specifying --use-submission-api to the sign command. If you want to keep using the API you are using now (via "sign-addon"), you must stay on v7.
Building web extension from /home/runner/work/le-git-graph/le-git-graph
FAIL

WebExtError: The extension could not be signed
at file:///home/runner/work/le-git-graph/le-git-graph/node_modules/web-ext/lib/cmd/sign.js:156:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Program.execute (file:///home/runner/work/le-git-graph/le-git-graph/node_modules/web-ext/lib/program.js:268:7)
at async file:///home/runner/work/le-git-graph/le-git-graph/node_modules/web-ext/bin/web-ext.js:13:1

Commits tab removed when using browser's back button

Going into another tab on GitHub and returning (by using the Browser's back button) removes the commits tab. In some cases, the Commits tab does not get removed, but rather the button will not work anymore until the page is refreshed. This was tested on Firefox.

firefox_d29erXJv1o

Graph node misaligned with commit list item.

Describe the bug
The height between two graph nodes is slightly smaller than the list item's height, as a result the graph will misaligned with the list after some pages.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Commits tag in this repository.
  2. Load some more pages.
  3. See the misaligned.

Expected behavior

The graph will always align to the tree.

Screenshots

image

Version information:

Additional context

I found that the height of graph's line is 57.5px, where the height of an item of list is 58.39px. And after I disabled the border of list item (which size is max(1px, 0,0625rem)), the list item's height becomes 57.49px that basiclly solves this problem.

image
image
image
image

My browser uses 'Medium' font size which rem seems to be 16px, and uses 'Arial' as default font (if this matters).

TypeError when fetching commits

I tested the firefox extension with a couple repos, and for some it works quite nice, for some others I get a TypeError:

TypeError: data.data.repository is null

in

fetchCommits.js:119:31

So far I could only reproduce this with some private repositories, so not sure what exactly triggers this :-/

Cannot set custom PAT

Describe the bug
Cannot set custom PAT

To Reproduce
Steps to reproduce the behavior:

  1. Generate a classic PAT with "full control of private repositories" scope.
  2. Copy and paste it into the Commits page.
  3. Notice it doesn't seem to do anything, and requests the custom PAT again.

Expected behavior
Extension should work after supplying it with a classic PAT.

Screenshots
https://cdn.imgchest.com/files/my8xcld3ro4.mp4

Version information:

  • OS: Windows
  • Browser: Firefox
  • Version: 1.2.0
  • Repository where this issue was observed: [private repository]

Additional context
Tried enabling/disabling UBO, no differences.

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.