donjayamanne / githistoryvscode Goto Github PK
View Code? Open in Web Editor NEWGit History for Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
License: MIT License
Git History for Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
License: MIT License
file history in the same branch is more useful, is it not supported now?
When viewing the file history, to diff seems reversed from what I would expect.
It shows
[current file] -> [old version]
which shows how to get the current version back to the version in the specified commit.
I was originally expecting
[old version] -> [current file]
which should show what changes have been made since the previous commit
@Spown wrote
well, I for one look in the log mostly when I need to know what happened for a quite a while ago, since the recent staff is still in my head. My team is rather small, but with larger dev teams it can be both the very recent or old. To name the average number of commits to check would actually be impossible, since sometimes you have 50 a day and sometimes you have 50 a month. The index of a commit and it's age rarely correlate. So with a paged view it is actually very difficult to say where the commit in question lies... especially if you don't see the number of pages.
Additionally I'm often looking into log not for one single commit, but for multiple and I would jump between them to see the development. Again with a paged view this turns into a clickfest. That's why I still have to grab SmartGit and use it's log...
I hope I'm not going too far by suggesting an on-demand populated list. This is similar to the infinite scrolling but with the the total number of items known in advance (if this possible with VSCode ofc.):
Thus if the page contains 5000 commits if the user clicks the scrollbar somewhere in the middle the bottom of the 49th and the top of the 50th container would get visible and only these would be loaded. the most "difficult part" would be to limit concurrent loads either by queuing them or by chaining them.
Merge the scripts as done in the Python (Jupyter) branch:
Makes it easier to manage the scripts
I have a git repo where I initially saved a file under a folder and did a commit. Then, I moved the file up to the root and did another commit.
When right-clicking and attempting to view the history of this file (by selecting Git: View File History > (select older checkin) > Compare against workspace file), I get an error.
In the output log, I get:
fatal: Path 'app.js' exists on disk, but not in '8b9d22275d80e46f12076fefb7c81e82817fd0fb'.
app.js was the file that moved between commits.
I am using 0.0.12.
This is a note to fix the localisation of the details view in the git log html page.
It seems that the inbuilt browser/tabviewer only supports en-US regardless of the locale that vscode is set to.
Even if I pass the locale to the browser via an attribute it doesn't work.
So for example toLocaleString('fr', options);
(French locale) will display in en-US locale.
Node however will localise dates and strings correctly.
So as long as we localise the html before sending to the browser we can get consistent language support.
Hi,
I'm trying to find the right command that I must write in keybindings.json, as follow:
{ "key": "ctrl+alt+g", "command": "view.file.gitHistory" },
Could you please tell me what's the command name and additionnaly update the README?
Thank a lot!
If open git log page and choose commit with multiline comment, currently it output in one line.
It would be nice if when we compare a file against the previous version we can move between te versions. If possible with all the versions listed an we can pick one version and always compare with the previous.
It would be very useful because you normally want to see in which commit do you make a change, and currently it is very hard because you have to open the versions one by one and compare against the previous.
If we can have the same list of versions that is displayed when we open ask for the file version and below the comparison of versions, this would be very easy to do.
Also because the list of versions of a file that is displayed with the command is usually cut by the available space, so you don't really have the change to read the commit comment.
Steps to reproduce:
Delete line using dd
and place the line with p
and you'll get the expected behavior.
Delete to end of another line using d$
and then attempt to place that text elsewhere with p
and you'll see that the contents of the first dd
operation is inserted instead of that from the d$
operation.
https://github.com/DonJayamanne/gitHistoryVSCode/blob/master/src/extension.ts#L11
We are taking over vscode's existing 'Git' output channel.
This causes some issues with overwriting the built in output and giving us 2 output windows named Git.
Should we rename it to Git History or Git Log?
Comparing a previous version to a workspace version the code here runs to create a temporary file for vscode to diff.
https://github.com/DonJayamanne/gitHistoryVSCode/blob/master/src/helpers/historyUtils.ts#L202
Stdout of for example
git show "$CommitSHA/somelargefile.js"
is asynchronously appended from stdout to a tmp file used for the vscode diff.
However for larger files fs.appendFile
can be called before the previous fs.appendFile
has finished causing the tmp file to be overwritten at random places
I solved it temporarily by using fs.appendFileSync
although a queuing strategy might be yield better performance.
If file name contain any HTML special char, Git History can't open it. For example if file name &some
, it tries to open &some
.
@kumarharsh
If the comments are very long, then the copy (blue) box is on the right
Ideally the comments should get truncated (with ellipsis) - that's what used to happen
Steps to Reproduce:
gives
src/browser/proxy.ts(33,25): error TS2304: Cannot find name 'Clipboard'.
It all runs as normal so I guess its just a typing issue.
looking at the npm install tree it seems the type definitions for clipboard are in
.\node_modules\@types\clipboard\index.d.ts
If I add
import * as Clipboard from 'clipboard';
at the top of proxy.ts
compile succeeds.
I am a newbie to typescript so I may be missing something.
If this is indeed a fix I can create a PR.
Let me know.
've done a complete re-install of VS Code. Without the icons extension, I don't get the admin prompt, but I still get nothing from git history. It looks like it is hanging.
Simplifying the debugging:
@kumarharsh
Take the html and save it into a file
heres the line that needs to be modified to take the html and save it into a file.
Then just launch the html file in chrome and debug.
https://github.com/DonJayamanne/gitHistoryVSCode/blob/master/src/logViewer/main.ts#L31
When displaying a file history I was getting confused with a duplicate commit message.
This was due to a stash.
https://github.com/DonJayamanne/gitHistoryVSCode/blob/master/src/helpers/historyUtils.ts#L119
Should the history include stashes? Or perhaps an indicator to say its a stash?
There are a few places where ls.on('exit...
is used to read the results of a ls.stdout.on.('data'...
stream.
This is wrong. I was surprised too.
From the node docs
The 'exit' event is emitted after the child process ends. If the process exited, code is the final exit code of the process, otherwise null. If the process terminated due to receipt of a signal, signal is the string name of the signal, otherwise null. One of the two will always be non-null.
Note that when the 'exit' event is triggered, child process stdio streams might still be open.
e.g. here
https://github.com/DonJayamanne/gitHistoryVSCode/blob/master/src/helpers/gitHistory.ts#L61
I observed some subtle bugs where on exit is fired before data stream has been flushed.
Incomplete history list and git log are undesirable results I experienced and behaviour can be different dependant on cpu and machine load so this is definitely one to fix.
We need to review the code and use on close or on end to guarantee completion of stream.
Do not reload Git history tab after switching to another, or remember position and selected commit.
It's very difficult to explore commits when after viewing changes in file and switching back you loose your position.
When comparing a previous version with current one, it would be great to be be able to actually edit the current version, just like VSCode natively offers the ability to edit when comparing against un/staged version.
PS: Awesome Extension!
In the File History selection box (when you are choosing old versions to compare against) some of the commits are duplicated.
Referencing issue microsoft/vscode#11739
On the latest update to VS Code, I get prompted to restart VS Code as admin to use git history, even when I am already running as administrator. I haven't managed to get it to work at all.
VS Code 1.5.1, Windows 10, Git History 0.0.10
I just updated to v 0.0.7, and git.viewFileHistory
stopped working -- when called from a keyboard shortcut.
Opening the command prompt (ctrl+shift+p) and running "Git: view file history" from there works correctly. On the other hand, pressing its keyboard shortcut ("ctrl+h" in my case, defined as { "key": "ctrl+h", "command": "git.viewFileHistory" }) triggers an error, with the text "fatal: Not a git repository (or any of the parent directories): .git" in the output console.
Everything was working fine prior to the extension upgrade, and I don't have problems with any other keyboard shortcuts. git.viewLineHistory works fine, both with and without a keyboard shortcut. I'm not sure what version of the extension I was on before, but it was at least 0.0.5. VSCode is at 1.3.1 and I'm running on Debian stretch.
Can you add argument to "git log" to get log of last N days or of last N commits? If it will speedup opening the log :)
For example:
git log 5 days
git log 5 commits
thank you.
The individual file history details feature is very useful, thank you - I was looking forward for that for some time. The dark blue color of the links is not very appealing though. Can you please change it to the standard color scheme in VS Code? I think the "standard" blue is #3769A6. This is how it looks like:
Thanks
I am getting a 'Not a git repository' error when getFileHistory() is executed. It seems to be happening because git rev-parse --git-dir
in getGitRepositoryPath() returns a relative path if the file is at the same level as the .git directory.
I added this before the resolve() in getGitRepositoryPath() and it works as expected:
if (path.dirname(log) === '.') {
log = path.dirname(fileName) + '/' + log;
}
Without the change, it works fine on files in subdirectories (when the git command returns an absolute path). I'm running on Windows.
Currently we do this
git log --format="%n95E9659B-27DC-43C4-A717-D75969757EA5%nrefs=%ncommit=%H%ncommitAbbrev=%h%ntree=%T%ntreeAbbrev=%t%nparents=%P%nparentsAbbrev=%p%nauthor=%an <%ae> %at%ncommitter=%cn <%ce> %ct%nsubject=%nbody=%b%n%nnotes=%N%n95E9659B-27DC-43C4-A717-D75969757EA1%n" --date-order --decorate=full --skip=0 --max-count=500 --numstat --
and use nodejs spawn and stdout.on('data' to read the result.
I ran some basic benchmarks and this takes 6 seconds on my install of windows 7 for around 100 commits at the command line.
Obviously it takes a bit longer to parse these entries but in the main it is the stdout that is slow.
git on windows seems to be the worst performer.
git on OSX has good performance.
git on Fedora 25 good performance.
If you examine the result of the above command you will see we are preloading a lot of stuff we will never likely use.
We should load only what we need to display the git graph and then think about loading the other bits on demand async whatever to get a better UX.
Example
I have 2 lines
aaaaaa (edited 1 month ago)
bbbbb (edited 2 month ago)
If I insert new row:
aaaaaa (edited 1 month ago)
NEW LINE (edited 2 month ago) ERROR
bbbbb ( no info??? ) ERROR
I just enter new row, without commit.
Need shift info by rows, if inserted new rows.
This is a work item to track moving
getGitPath
getGitRepositoryPath
to the activate event
... as these only need to be actioned once per extension session.
Currently these functions are run on every git command which seems unnecessary.
This should help performance especially on windows where we query the registry for git location on every git command.
I used to be a Webstorm user. The Git extension in Webstorm has a feature that allows the user to view all the modified files for a single commit _(your extension already has this feature)_. In addition, users can also view git diff for each modified file in side by side mode by click the path of files. I hope you can consider adding this feature to the extension.(My English is poor.Sorry for the grammer mistake)
Hello,
I just installed the add-on, had a look at the git file history of a few commits and then found all these tmp- files in my tmp dir. They are for some reason being brought up in my linting dialogue which is not good news.
When I restart vscode they are gone, but i don't want to have to do that every time i look at a git history. It does not matter if the files are open or not, they still show up.
Please see the attached screen shot, is this a bug or can I change a setting? THANKS.
PS I am using Fedora Linux (which is working 100% perfectly for vscode :)
I see both examples in the code which should I use?
There is a tslint rule for no 1. (presumably because its defacto) so that's easier to enforce but coming from c# I tend to the later.
if (some condition) {
dosomething;
} else {
dosomethingelse;
}
try {
dosomething;
} catch {
some error;
}
or
if (some condition) {
dosomething;
}
else {
dosomethingelse;
}
try {
dosomething;
}
catch {
some error;
}
As a user, I want to be able to ensure git log
is called with the --follow
option, so that when I rename/move files I will still see the full git history for those files.
Hey I like gitHistory a lot!
But I have to
press F1
type Git
select Git: View History
select either Line or File
which is rather inconvenient...
gitBlame plugin just displays a line in the footer ... this is very nice, but insufficient.
I wonder if there is something inbetween?
I would love to have a small status in the footer, with two buttons for file and line history.
Or at least instructions for a keyboard shortcut
Command just seems to put the tab into a long loop, and does not create the history graph.
Is there a version of Git that I need to install?
I am working on Windows and my development is on a shared drive.
Hi and thank you for your extension.
I'm trying to find what are the commandIds for Git : View File History Git : View Line History
Could you please complete the following json snippet :) ?
// Git
{
"key": "ctrl+alt+g",
"command": "workbench.view.git.???",
}
Thanks and kind regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.