Skip to content

Commit af09c82

Browse files
committed
Right-click context menus, allowing: creating, renaming, deleting & checking out branches, adding & deleting tags, and copying commit hash to clipboard
1 parent 9724ec9 commit af09c82

File tree

10 files changed

+618
-79
lines changed

10 files changed

+618
-79
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 1.1.0 - 2019-02-11
4+
* Perform Git actions directly from Git Graph by right clicking on a commit / branch / tag:
5+
* Create, Checkout, Rename & Delete Branches
6+
* Add & Delete Tags
7+
* Copy Commit Hash to Clipboard
8+
* Graph generation improvements
9+
310
## 1.0.1 - 2019-02-10
411
* Detect & display lightweight tags
512

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# Git Graph extension for Visual Studio Code
22

3-
View a Git Graph of your repository in Visual Studio Code. Configurable to look the way you want!
3+
View a Git Graph of your repository, and easily perform Git actions from the graph. Configurable to look the way you want!
44

55
![Recording of Git Graph](https://github.com/mhutchie/vscode-git-graph/raw/master/resources/demo.gif)
66

77
## Features
88

9-
* Git Graph Visualisation
10-
* Display Local & Remote Branches
11-
* Display Refs: Heads, Tags & Remotes
12-
* Display Uncommitted Changes
9+
* Git Graph View:
10+
* Display:
11+
* Local & Remote Branches
12+
* Local Refs: Heads, Tags & Remotes
13+
* Local Uncommitted Changes
14+
* Perform Git Actions (available by right clicking on a commit / branch / tag):
15+
* Create, Checkout, Rename & Delete Branches
16+
* Add & Delete Tags
17+
* Copy Commit Hash to Clipboard
1318
* Configurable settings (e.g. graph style, branch colours, and more...)
1419
* "Git Graph: View Git Graph" launch command in the Command Palette
1520
* "Git Graph" launch button in the Status Bar
@@ -34,11 +39,7 @@ This extension contributes the following commands:
3439

3540
## Coming Soon
3641

37-
* Interact with commits shown on the Git Graph:
38-
* View Changes in commit
39-
* Create Branch from commit
40-
* Add Tag to commit
41-
* Checkout Branch
42+
* View Changes in commit by right clicking on it
4243

4344
## Release Notes
4445
Detailed Release Notes are available [here](CHANGELOG.md).

media/main.css

Lines changed: 96 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ body.notGitRepository h1, body.notGitRepository p{
1919
left:8px;
2020
top:71px;
2121
}
22-
#commitGraph circle.first{
22+
#commitGraph circle.current{
2323
fill:var(--vscode-editor-background);
2424
stroke-width:2;
2525
}
26-
#commitGraph circle:not(.first){
26+
#commitGraph circle:not(.current){
2727
stroke:var(--vscode-editor-background);
2828
stroke-width:1;
2929
stroke-opacity:0.75;
@@ -46,11 +46,12 @@ body.notGitRepository h1, body.notGitRepository p{
4646
#commitTable th, #commitTable td{
4747
white-space:nowrap;
4848
font-size:14px;
49+
cursor:default;
4950
}
50-
#commitTable tr:hover td{
51+
#commitTable tr:hover td, #commitTable tr.commit.contextMenuActive td{
5152
background-color:rgba(128,128,128,0.15);
5253
}
53-
#commitTable tr:hover:last-child td{
54+
#commitTable tr.noHighlight:hover td{
5455
background-color:unset;
5556
}
5657
#commitTable td{
@@ -63,7 +64,6 @@ body.notGitRepository h1, body.notGitRepository p{
6364
background-color:rgba(128,128,128,0.2);
6465
line-height:18px;
6566
padding:6px 12px;
66-
cursor:default;
6767
}
6868
#commitTable th:first-child{
6969
border-left-width:0;
@@ -87,8 +87,9 @@ body.notGitRepository h1, body.notGitRepository p{
8787
padding:0 5px;
8888
margin-right:5px;
8989
height:12px;
90+
cursor:default;
9091
}
91-
.gitRef > svg{
92+
.gitRef > svg, #dialog svg{
9293
display:inline;
9394
fill:rgb(128,128,128);
9495
margin-right:3px;
@@ -134,7 +135,7 @@ body.notGitRepository h1, body.notGitRepository p{
134135
}
135136
#showRemoteBranchesCheckbox{
136137
width:14px;
137-
vertical-align:text-top
138+
vertical-align:text-top;
138139
}
139140
#refreshBtn{
140141
position:absolute;
@@ -160,6 +161,93 @@ body.notGitRepository h1, body.notGitRepository p{
160161
cursor:pointer;
161162
}
162163

164+
#contextMenu{
165+
display:none;
166+
position:absolute;
167+
background-color:var(--vscode-menu-background);
168+
box-shadow:1px 1px 2px 1px var(--vscode-widget-shadow);
169+
color:var(--vscode-menu-foreground);
170+
list-style-type:none;
171+
margin:0;
172+
padding:4px 0;
173+
}
174+
#contextMenu.active{
175+
display:block;
176+
}
177+
#contextMenu li{
178+
padding:6px 20px;
179+
cursor:default;
180+
}
181+
#contextMenu li:hover{
182+
background-color:var(--vscode-menu-selectionBackground);
183+
}
184+
185+
#dialog, #dialogBacking{
186+
display:none;
187+
}
188+
#dialog.active{
189+
display:block;
190+
position:fixed;
191+
background-color:var(--vscode-menu-background);
192+
padding:10px;
193+
left:50%;
194+
top:50%;
195+
transform:translateX(-50%) translateY(-50%);
196+
border:1px solid rgba(128,128,128,0.5);
197+
border-radius:5px;
198+
text-align:center;
199+
max-width:360px;
200+
z-index:10;
201+
}
202+
#dialog label{
203+
margin-top:10px;
204+
display:inline-block;
205+
}
206+
#dialog input[type=text]{
207+
margin-top:10px;
208+
width:100%;
209+
padding:4px;
210+
box-sizing:border-box;
211+
}
212+
#dialog input[type=checkbox]{
213+
vertical-align:text-top;
214+
}
215+
#dialog .roundedBtn{
216+
display:inline-block;
217+
line-height:24px;
218+
padding:0 15px;
219+
margin:10px 6px 0 6px;
220+
height:24px;
221+
border-radius:12px;
222+
}
223+
#dialog .errorReason{
224+
display:inline-block;
225+
font-style:italic;
226+
margin-top:10px;
227+
text-align:left;
228+
}
229+
#dialogBacking.active{
230+
display:block;
231+
position:fixed;
232+
left:0;
233+
right:0;
234+
top:0;
235+
bottom:0;
236+
z-index:9;
237+
background-color:var(--vscode-widget-shadow);
238+
opacity:0.5;
239+
}
240+
#dialog.noInput #dialogAction, #dialog.inputInvalid #dialogAction{
241+
background-color:rgba(128,128,128,0.2);
242+
opacity:0.5;
243+
}
244+
#dialog.noInput #dialogAction{
245+
cursor:default;
246+
}
247+
#dialog.inputInvalid #dialogAction{
248+
cursor:help;
249+
}
250+
163251
.roundedBtn{
164252
display:block;
165253
background-color:rgba(128,128,128,0.2);
@@ -171,6 +259,6 @@ body.notGitRepository h1, body.notGitRepository p{
171259
.roundedBtn:hover{
172260
background-color:rgba(128,128,128,0.4);
173261
}
174-
#commitTable th, #loadingHeader, .unselectable, .roundedBtn, #controls label{
262+
#commitGraph, #commitTable th, #commitTable td, .gitRef, #loadingHeader, .unselectable, .roundedBtn, #controls label{
175263
user-select:none;
176264
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "git-graph",
33
"displayName": "Git Graph",
4-
"version": "1.0.1",
4+
"version": "1.1.0",
55
"publisher": "mhutchie",
66
"author": {
77
"name": "Michael Hutchison",
88
"email": "michael@16right.com"
99
},
10-
"description": "View a Git Graph of your repository",
10+
"description": "View a Git Graph of your repository, and perform Git actions from the graph.",
1111
"keywords": [
1212
"git",
1313
"graph"

resources/demo.gif

163 KB
Loading

0 commit comments

Comments
 (0)