Coder Social home page Coder Social logo

sertion / vscode-gitblame Goto Github PK

View Code? Open in Web Editor NEW

This project forked from waderyan/vscode-gitblame

69.0 69.0 31.0 8.98 MB

Visual Studio Code Extension - See Git Blame info in status bar.

Home Page: https://marketplace.visualstudio.com/items/waderyan.gitblame

License: MIT License

TypeScript 99.67% JavaScript 0.33%
git-blame visual-studio-code vscode-extension

vscode-gitblame's People

Contributors

aaravind100 avatar abarichello avatar allight avatar angelfraga avatar atkinchris avatar azanli avatar benlanglois avatar carloscz avatar dewe avatar dimitarnestorov avatar f4n0 avatar fogzot avatar j-em avatar joaomoreno avatar madprog avatar radar avatar razinj avatar sertion avatar tdhsmith avatar vadzimdambrouski avatar wade-ryan avatar yottster 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

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-gitblame's Issues

Add ignore whitespace-mode

Add a configuration to enable ignore whitespace-mode (git blame -w).

Use the name gitblame.ignoreWhitespace. It should be a boolean.

Short hash

Please add a short hash token to normalizeCommitInfoTokens.

Git command not found

Git command will not be found/usable if not on path (?). VS Code already has a setting "git.path" which is set but not used by git blame it seems.

So Git works as expected in VS Code, Git Blame reports an error that git can not be executed.

[ 08:45:49 | command ] git rev-parse --show-toplevel
[ 08:45:49 | critical ] Error: spawn git ENOENT
[ 08:45:49 | info ] Will not try to blame file "c:\Users\marc.....html" as it is outside of the current workspace
[ 08:45:53 | info ] Will not try to blame file "extension-output-#13" as it is outside of the current workspace

Note: File is not outside of Workspace.

time.custom is deprecated

Every time I open the plugin pop-up to get details on the commit, I see this message.

Running on macOS Mojave 10.14.5, installed from the extensions market.

Add "Copy URL" button as well as just "view"

I use separate browsers for general browsing and for work-related stuff. (It helps with managing logins and other extension config things).

When I do a git blame, the extension only gives me the option to "view" which opens a new (default) browser window.

It would be better if there was a button to "Copy URL" (or an option in the config to change "View" to this). Currently I have to "view", copy the URL from the address bar, open a new tab in the other browser, paste the URL, then close the default browser window. It's pretty cumbersome.

There are a number of cases where it's preferable to just copy the URL to clipboard rather than open a browser tab.

If I get chance to, I'll implement this myself. But, as it stands, I don't really know anything about VSCode's extension API.

View button on a BitBucket repo redirects to an incorrect path

Recently the view button redirects to repoaddress/commit/hash, which is an incorrect url:
the correct address should be: repoaddress/commits/hash
The problem is fixed if the isWebPathPlural configuration by default changes to true, I will do a PR with the suggested change.

Support blame for git submodules

We can look in parent directories for a .git file that will contain a relative path to the git repository to use for the sub-module.

Add configurable link to online git tool to view commit

Add an option where we can put an URL with a token for the hash. If this setting is available to us we should display a link in the info message to go there.

Example value: https://github.com/Sertion/vscode-gitblame/commit/${hash}

Exception UriError thrown when running "quick info" and "view online" commands

I have a repo in which running the above noted commands results in this:

screen shot 2018-05-30 at 00 23 19

The output pane shows this:
[ 00:22:05 | command ] /usr/local/bin/git ls-remote --get-url origin
The result of which, when run in a terminal, follows the following format:
[email protected]:user/repository

Changing the remote to the format ssh://[email protected]/user/repository makes the extension work.

This relates to issue microsoft/vscode#38696 but that is closed. It is wrong to treat 'scp' style URIs like the format above as URIs per the rfc3986 spec, but I don't really know if this is an example of this extension misusing the vscode URI class or if there should be a pull request/issue raised on vscode to make that class recognise scp URIs.

Either way I feel like this extension should recognise the "scp-like" syntax as it is totally valid to use per the git documentation, and is also what most people will end up with usually since it's what github and others recommend when cloning by ssh:

screen shot 2018-05-30 at 00 38 34

Not working and not useful error message

I'm using Git Blame in VSCode with Windows10 and WSL Ubuntu.
I'm using Github.com Repositories with 2FA with SSH remotes in all repos.

I don't have any annotations and if I try to show something per Git Blame: Show quick Info I will get this error:
git_blame_code_error

Since I working almost only with the WSL, it could be that my Git in Windows (CMD, Path, etc) isn't properly configured. But I don't have any clue which Git information Git Blame is using, since it should simply use the SSH credentials.

View on Bitbucket 404s

The plugin opens a new window to the bitbucket path that uses /commit/ in the URL path, but it should use /commits/ instead. Quick fix, just add an s.

isWebPathPlural should be inferred from remote origin

Is it not possible to infer the value of isWebPathPlural from the remote origin, rather than have to set it explicitly? I have to work with repos on bitbucket, github and gitlab, so having one value for this config item doesn't work well for me.

GIT icon uncredited

The logo you are using belongs to the GIT Project, part of the Software Freedom Conservancy. There is no credit mention of this though. You should include the following link as an attribution:

https://git-scm.com/downloads/logos

You might also consider using a different logo altogether. The current logo is used by multiple different Git related projects and the current logo will make it hard for you to stand out.

Display years when relevant

The average age of the code base I mostly work on is probably around 7 years (some lines up to at least 14 years).

I'd like large time spans to display years and months instead of just months, e.g 8 years and 1 month instead of 97 months.

Include ${commit.linediff}

It would be interesting if upon clicking on the status bar, the user could see a small diff of the line. Git Lens has something similar as popup over each line, but I find it very intrusive. So I believe that just a ${commit.linediff} variable (with the possibility of placing it in a new line) would be more than enough!

Extension issue

  • Issue Type: Bug
  • Extension Name: gitblame
  • Extension Version: 2.6.3
  • OS Version: Linux x64 5.0.2-050002-generic
  • VSCode version: 1.32.3

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

{
	"activationTimes": {
		"startup": false,
		"codeLoadingTime": 35,
		"activateCallTime": 0,
		"activateResolvedTime": 0,
		"activationEvent": "onDebugResolve:chrome"
	}
}

Support AWS CodeCommit with "guess" option ?

Hey,

TL;DR : how to have the plugin auto guess the correct URI for AWS CodeCommit. bottom line questions are at the very bottom.

I'm trying to get the URL thingy working for an AWS CodeCommit repository.

There's multiple way to clone such repository :

  • SSH
  • HTTPS

I used HTTPS.

There's multiple ways to authenticate to the git repository for checking out :

  • Specific "https" credentials bound to that usage
  • SSH key configured for that
  • a git helper provided by AWS whom relies on other classic AWS authentication methods.

I use the later, but I'm unsure if this is important to the use of this extension.

When cloning a repository via HTTPS, regardless of the authentication method, we get an URI like this : https://git-codecommit.[AWS_REGION].amazonaws.com/v1/repos/[REPONAME]

This extension uses this URI by default to construct the link for viewing : I believe this URI cannot be used via a browser to browse the repository. I tried to authenticate with credentials fetched from the aws-cli helper, with no success :

$ echo 'protocol=https
host=eu-west-1.console.aws.amazon.com
path=codesuite/codecommit/repositories/[REPONAME]' | aws codecommit --profile [AWS_PROFILE] --region eu-west-1 credential-helper get

This returns a username & password that I used to access :

All of these URI yield :

<AccessDeniedException>
  <Message>Invalid request</Message>
</AccessDeniedException>

From the AWS Console, the browsing URI to see a commit details would be https://[AWS_REGION].console.aws.amazon.com/codesuite/codecommit/repositories/[REPONAME]/commit/[COMMITID]?region=[AWS_REGION] (I'm not sure about the usefulness of this last AWS_REGION, as removing it let stuff working).

I have read the README about constructing a custom URI with the help of variables, an I can make one work for me : https://eu-west-1.console.aws.amazon.com/codesuite/codecommit/repositories/${project.name}/commit/${hash}, but this assumes all repository will be in eu-west-1

  1. How could the region could be parsed / obtained to fill in the URI ?
  2. How could we have the plugin "guess" this correctly ?

The "git.path" property is not an executable

I keep getting this error at the top of the window.

The "git.path" property is not an executable

In the output console, it says:

critical ] Error: Can not execute "/usr/bin/git"

The git.path is set to "usr/bin/git" & I don't have problems with any other extensions that use git.
I'm on Kubuntu 16.04 x64 if it helps.

Customizable status bar message format

Adding some customisation to the status bar message would be neat.

Info we currently have easy access to:

  • Author
    • Name
    • E-mail
    • Timezone
  • Commit
    • Hash
    • Time stamp
    • Commit message summary
    • What line number the line had before changes
    • Current line number
    • What filename the line originally came from (if we can use the -M and -C flags in the future)

Tools we can use:

  • Momentjs
  • TextDecorator.toDateText
  • TextDecorator.parseTokens (${token,options})

Blaming still open and deleted file crashes the extension

  • Issue Type: Bug
  • Extension Name: gitblame
  • Extension Version: 2.8.0
  • OS Version: Darwin x64 18.6.0
  • VSCode version: 1.36.0-insider
{
	"messages": [],
	"activationTimes": {
		"startup": true,
		"codeLoadingTime": 43,
		"activateCallTime": 1,
		"activateResolvedTime": 15,
		"activationEvent": "*"
	},
	"runtimeErrors": [
		{
			"name": "Error",
			"message": "ENOENT: no such file or directory, watch #PATH_TO_FILE'"
		}
	]
}

Extension host crashing when renaming file

When I rename a file while a cursor is active inside that file, the vscode extension host crashes. I've used this extension for a couple of years and this is new behaviour. Only able to stop it by disabling the extension.

Blame uses committer not author

If the committer and author are different for a commit, blame always uses committer even if you specify author.name. I wonder if this is what's behind #32

Looking at the code, I believe it is due to the following problem. When blame.ts initializes a commit object, it uses the exact same reference for emptyAuthor for both author and commit. When stream.ts reads the information, it mutates the owner object, which in this case points to both the author and the commit. I think the solution is simply to copy the object when initializing in blame.ts.

I would submit a CR but don't want to spend the time setting everything up, reproing, creating a test, etc.

Fix in blame.ts

const commitInfo = {
            author: {...emptyAuthor},
            committer: {...emptyAuthor},

Original blame.ts

const commitInfo = {
            author: emptyAuthor,
            committer: emptyAuthor,
            filename: "",
            generated: true,
            hash: HASH_NO_COMMIT_GIT,
            summary: "",
        } as IGitCommitInfo;

stream.ts - point where it is mutated

       if (keyPrefix === "author") {
            owner = commitInfo.author;
        } else if (keyPrefix === "committer") {
            owner = commitInfo.committer;
        }

        if (!owner.temporary && !keySuffix) {
            owner.name = value;

Commiter has replaced author by default

The documentation says the authors name is rendered by default in the status bar, e.g. "Blame ${author.name} ( ${time.ago} )", however with a recent update I've had to switch it to "Blame ${committer.name} ( ${time.ago} )" in my user settings to view the correct author name.

Unable to open 'My Project': resource is not available.

I am getting the following error when I try the "View last change online" command.

Unable to open 'My Project': resource is not available.

Below is the output from my extensions view:

[ 19:23:18 | info ] Will not try to blame file "/extension-output-#4" as it is outside of the current workspace
[ 19:23:31 | command ] git ls-remote --get-url origin
[ 19:23:31 | info ] Clearing the file "/path/to/my/project/package.json" from the internal cache
[ 19:24:03 | command ] git ls-remote --get-url origin

Any ideas what is going on? I am happy to provide more information. Thanks.

Dot in username generates wrong repository URL

Hello.
I am using VS Code on Windows 10 64bit.
I have a repository configured to use a remote as follows:

git@my-gitlab-instance-url:name.surname/repo-name.git

Everything was working fine until recently. However, since this morning, when clicking on the "View" button inside VS Code, i get redirected to the wrong URL.

This is what I get (notice the extra / between name and surname):

https://my-gitlab-instance-url/name/.surname/repo-name/commit/commit-hash

This is what I used to get until recently:

https://my-gitlab-instance-url/name.surname/repo-name/commit/commit-hash

I am unfortunately unable to pinpoint exactly when this behaviour changed, as I don't normally use the blame functionality from within VS Code.

Doesn't work multi-root with workspace

when working with multi-root workspace the commit information is displayed only for files from the first directory from the other is not displayed.

VSCode - 1.16.0 / 1.17.0-insider
Git Blame - 2.1.0

2017-09-08_10h52_51

error blame info

After I updated line 3, the blame info on the status bar shows a wrong time 18 days ago.
And git blame -- .eslintrc.json shows the right info.

my extension version is 2.4.4

vsc-ext-git-blame-issue

SourceTree integration

I'm a fan of SourceTree and I use it everyday. Would it be possible to make the View button open the commit in SourceTree? BitBucket's website is kinda bulky and takes too much time to load.

If you don't use SourceTree I guess I will make a PR, but would love to hear if you would approve such a PR and if there is anything to keep in mind while working on it.

Repository info for gitblame.commitUrl

Please provide the repository name (and other repository info if known) for the gitblame.commitUrl setting. Using that it would be possible to set the setting globally instead of per project.

Information is no longer displayed in the toolbar

This extension used to work wonderfully. I had to stop working on a project for a few weeks. When I come back, I no longer see any information. I uninstalled and reinstalled the extension. I also tried switching to other Git branches. Nothing is displayed.

I am happy to help troubleshoot what is happening, but I don't know where to start looking.

gitblame

Allow string manipulation in commitUrl

Hello,

First of all, your extension is very handy !

I've got a request about the way the extension generates links (commitUrl).

I need to upper case the project name to fit with a Phabricator instance.

The URL would be of this format : https://my-phabricator-instance/rMYPROJECT4823fec0348bf0606bee42244425913eb2b00254.

But setting commitUrl value as https://my-phabricator-instance/r${project.name}${hash} does not work (because project is named in lowercase : myproject.git.

Is it possible to allow string manipulation on tokens ?

Shows incorrect hash after checking out outside of VSCode

I checked the hash with the extension. Did a checkout +1 (so I revert to the hash BEFORE the hash being displayed) in my terminal outside of VSCode (vscode updates with correct lines of code). This extension does not update the hash though, it displays the old hash.

Nothing shown in bar

Updated from 1.5 -> 1.8.0 this morning. Extension now shows nothing in the bar, while it was working before this weekend's updates

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.